CN109241318B - Picture recommendation method and device, computer equipment and storage medium - Google Patents

Picture recommendation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN109241318B
CN109241318B CN201811106466.4A CN201811106466A CN109241318B CN 109241318 B CN109241318 B CN 109241318B CN 201811106466 A CN201811106466 A CN 201811106466A CN 109241318 B CN109241318 B CN 109241318B
Authority
CN
China
Prior art keywords
picture
pictures
candidate
training
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811106466.4A
Other languages
Chinese (zh)
Other versions
CN109241318A (en
Inventor
吴壮伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811106466.4A priority Critical patent/CN109241318B/en
Priority to PCT/CN2018/124798 priority patent/WO2020056999A1/en
Publication of CN109241318A publication Critical patent/CN109241318A/en
Application granted granted Critical
Publication of CN109241318B publication Critical patent/CN109241318B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Probability & Statistics with Applications (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a picture recommending method, a picture recommending device, computer equipment and a storage medium. The method comprises the following steps: classifying the pre-stored candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets; establishing a picture recommendation model according to a preset feature matching formula and a plurality of candidate picture sets; training the picture recommendation model through a plurality of groups of training parameters and a plurality of training pictures; if the pictures to be matched input by the user are received, matching the pictures to be matched with a plurality of candidate picture sets according to the trained picture recommendation model, and calculating to obtain matching probability of the corresponding candidate pictures; and sequencing the obtained matching probabilities of all the candidate pictures, and obtaining target pictures according to the preset number of the target pictures. The invention is based on intelligent decision technology, can efficiently and accurately match the pictures input by the user to obtain similar pictures, greatly reduces errors in the picture matching process, and saves matching time.

Description

Picture recommendation method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for recommending pictures, a computer device, and a storage medium.
Background
In the development process of the computer programming project, one input picture is required to be matched with a plurality of pictures in a picture library, so as to obtain a target picture similar to the input picture in the picture library. In the existing picture matching method, the overall characteristics of the picture are matched to cause a large matching error rate, and the matching of each pixel in the picture is long in time consumption due to huge calculation amount. Therefore, the existing picture matching method has the problem that similar pictures cannot be obtained through efficient and accurate matching.
Disclosure of Invention
The embodiment of the invention provides a picture recommending method, a picture recommending device, computer equipment and a storage medium, and aims to solve the problem that similar pictures cannot be obtained through efficient and accurate matching in the prior art.
In a first aspect, an embodiment of the present invention provides a method for recommending pictures, including:
acquiring a plurality of pre-stored candidate pictures, and classifying the candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets;
establishing a picture recommendation model according to a preset feature matching formula and a plurality of obtained candidate picture sets;
training the established picture recommendation model through a plurality of preset training parameters and a plurality of preset training pictures to obtain a trained picture recommendation model;
If the pictures to be matched input by the user are received, matching the pictures to be matched with a plurality of candidate picture sets according to the trained picture recommendation model, and calculating to obtain matching probability of the corresponding candidate pictures;
and sequencing the obtained matching probabilities of all the candidate pictures, and obtaining target pictures according to the preset number of the target pictures.
In a second aspect, an embodiment of the present invention provides a picture recommendation apparatus, including:
the picture classifying unit is used for acquiring a plurality of pre-stored candidate pictures and classifying the candidate pictures according to a preset picture classifying rule to obtain a plurality of candidate picture sets;
the picture recommendation model construction unit is used for constructing a picture recommendation model according to a preset feature matching formula and a plurality of obtained candidate picture sets;
the picture recommendation model training unit is used for training the established picture recommendation model through a plurality of preset training parameters and a plurality of preset training pictures to obtain a trained picture recommendation model;
the matching probability calculation unit is used for matching the picture to be matched with the plurality of candidate picture sets according to the trained picture recommendation model if the picture to be matched input by the user is received, and calculating the matching probability of the corresponding candidate picture;
The target picture acquisition unit is used for sequencing the obtained matching probabilities of all the candidate pictures and acquiring target pictures according to the preset number of target pictures.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the picture recommendation method described in the first aspect when executing the computer program.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where the computer readable storage medium stores a computer program, where the computer program when executed by a processor causes the processor to perform the picture recommendation method according to the first aspect.
The embodiment of the invention provides a picture recommending method, a picture recommending device, computer equipment and a storage medium. The candidate pictures are classified into a plurality of candidate picture sets, a picture recommendation model is established according to the candidate picture sets, the picture recommendation model is trained through preset training parameters and training pictures, and a target picture with the highest matching probability is obtained through matching according to the trained picture recommendation model and is output, so that the pictures input by a user can be accurately matched to obtain similar pictures, errors in the picture matching process are greatly reduced, and matching time is saved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a picture recommendation method according to an embodiment of the present invention;
fig. 2 is another flow chart of a picture recommendation method according to an embodiment of the present invention;
fig. 3 is a schematic sub-flowchart of a picture recommendation method according to an embodiment of the present invention;
fig. 4 is another schematic sub-flowchart of a picture recommendation method according to an embodiment of the present invention;
fig. 5 is another schematic sub-flowchart of a picture recommendation method according to an embodiment of the present invention;
fig. 6 is a schematic block diagram of a picture recommendation device provided by an embodiment of the present invention;
FIG. 7 is another schematic block diagram of a picture recommendation apparatus according to an embodiment of the present invention;
fig. 8 is a schematic block diagram of a subunit of a picture recommendation device according to an embodiment of the present invention;
FIG. 9 is a schematic block diagram of another subunit of a picture recommendation device according to an embodiment of the present invention;
FIG. 10 is a schematic block diagram of another subunit of a picture recommendation device according to an embodiment of the present invention;
fig. 11 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Referring to fig. 1, fig. 1 is a flowchart illustrating a picture recommendation method according to an embodiment of the present invention. The picture recommending method is applied to a server side and is executed through application software installed in the server side, wherein the server side is an enterprise terminal for executing the picture recommending method to recommend similar pictures.
As shown in fig. 1, the method includes steps S101 to S105.
S101, acquiring a plurality of pre-stored candidate pictures, and classifying the candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets.
The server side stores a plurality of candidate pictures in advance, and classifies the candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets. The server side is the enterprise terminal for constructing and using the picture recommendation model. And classifying all the candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets. The picture classification rule is rule information for classifying candidate pictures, wherein the picture classification rule comprises a feature extraction formula and a K-means clustering algorithm.
In an embodiment, as shown in fig. 2, step S101A is further included before step S101.
S101A, adjusting the formats of all the pre-stored candidate pictures according to a preset format adjustment rule to obtain candidate pictures with uniform formats.
Because the pre-stored candidate pictures cannot ensure complete unification of the formats, the formats of all the pre-stored candidate pictures can be uniformly adjusted according to preset format adjustment rules before classifying the candidate pictures. For example, the sizes of all candidate pictures may be adjusted to adjust the resolutions of all candidate pictures to 200×200, so that candidate pictures with uniform formats may be obtained.
In one embodiment, as shown in FIG. 3, step S101 includes sub-steps S1011, S1012, and S1013.
And S1011, carrying out feature extraction on the candidate pictures according to a preset feature extraction formula to obtain feature variables of all the candidate pictures.
And extracting the feature variables of all the candidate pictures according to a preset feature extraction formula. The preset feature extraction formula is constructed based on a convolutional neural network. The preset feature extraction formula comprises a first convolution calculation formula, a pooling calculation formula, a second convolution calculation formula, a first full-connection calculation formula and a second full-connection calculation formula. And extracting feature variables of all candidate pictures through a feature extraction formula. The feature variables of the candidate pictures are multidimensional vectors which are obtained after feature extraction of the pictures and used for reflecting the characteristics of the pictures, and the computer program cannot identify different pictures, but after converting the pictures into the feature variables, the computer program can identify the different pictures by analyzing the feature variables of the pictures.
Specifically, if the resolution of the input candidate picture is 200×200, according to the first convolution calculation formula, taking the resolution of 10×10 as a window and the step length of 1, performing convolution operation to obtain a vector matrix with the size of 190×190, namely, shallow features of the candidate picture; according to a pooling calculation formula, taking the resolution of 10 multiplied by 10 as a window, taking the step length as 10, and carrying out downsampling to obtain a vector matrix with the size of 18 multiplied by 18, namely, the deep-level feature of the candidate picture; and performing convolution operation with the resolution of 2 multiplied by 2 as a window and the step length of 2 according to a second convolution calculation formula to obtain a vector matrix with the size of 9 multiplied by 9. Calculating the obtained 9×9 vector matrix by a first full-connection calculation formula, wherein the first full-connection formula contains five nodes, each node is associated with the 9×9 vector matrix, that is, the values of five nodes associated with the 9×9 vector matrix are calculated by five calculation formulas respectively, the first calculation formula can be expressed as c1=w1×x1+b1, wherein C1 is the calculated value of the first node, x1 is the value of the candidate picture vector matrix, W1 and B1 are the preset parameter values in the first calculation formula associated with the first node and the vector matrix, and the values of five nodes associated with the vector matrix can be calculated by the five calculation formulas; calculating the values of the five nodes through a second full-connection calculation formula to obtain a characteristic variable of the final candidate picture, wherein the calculation formula is F1=a1×C1+a2×C2+a3×C3+a4×C4+a5×C5; wherein C1, C2, C3, C4, C5 are values of five nodes associated with the vector matrix of the candidate picture, a1, a2, a3, a4, a5 are preset parameter values from five nodes to a final output node, and finally, the feature variable of the candidate picture is a vector matrix of 1×128 dimensions, which can be represented by f1= (F1, F2 … … F128).
According to the characteristic extraction formula, characteristic extraction can be carried out on all candidate pictures to obtain characteristic variables of all candidate pictures, namely F1, F2 and F3 … … Fn.
S1012, clustering the characteristic variables of the candidate pictures according to a preset K-means clustering algorithm to obtain a plurality of groups containing mass centers.
And clustering the characteristic variables of the candidate pictures according to a preset K-means clustering algorithm to comprise clustering results of a plurality of groups. Specifically, the number K of finally required groups is set in a K-means clustering algorithm, and feature variables of all candidate pictures are clustered according to the numerical value of K, so that feature variable values of mass centers of each group in the K groups are obtained. For example, setting k=5 in the K-means clustering algorithm, so as to obtain 5 clusters and feature variable values of centroids of each cluster, wherein the centroids are center points in the clusters, and the feature variable values of the centroids are mean values of feature variables of the clusters.
And S1013, classifying all the candidate pictures according to the obtained multiple groups to obtain multiple candidate picture sets containing the candidate pictures.
And classifying all the candidate pictures according to the obtained multiple groups to obtain multiple candidate picture sets containing the candidate pictures. Because each cluster after clustering contains a characteristic variable value as the mass center of the cluster, a mass center closest to the candidate picture can be obtained by calculating the distance between the candidate picture and all the mass centers, and the candidate picture is classified into the cluster corresponding to the mass center. After classifying all candidate pictures according to the method, a plurality of candidate picture sets containing corresponding candidate pictures can be obtained.
S102, establishing a picture recommendation model according to a preset feature matching formula and the obtained multiple candidate picture sets.
And establishing a picture recommendation model according to a preset feature matching formula and the obtained multiple candidate picture sets. In order to recognize the picture input by the user and calculate the matching probability of the picture input by the user and the candidate pictures, a picture recommendation model is established through a preset feature matching formula and a plurality of obtained candidate picture sets. Specifically, the preset feature matching formula is s=1/(((f 1-t 1)) 2 +(f2-t2) 2 +……+(fn-tn) 2 ) -1 +1), wherein f1 and f2 … … fn are feature variable values of a certain candidate picture, t1 and t2 … … tn are feature variable values of a picture input by a user, and n=128 in the above formula because the feature variable of the candidate picture is a vector matrix of 1×128 dimensions.
S103, training the established picture recommendation model through a plurality of preset training parameters and a plurality of preset training pictures to obtain a trained picture recommendation model.
And training the established picture recommendation model through a plurality of preset training parameters and a plurality of preset training pictures to obtain a trained picture recommendation model. Specifically, each set of training parameters includes a learning rate, a training frequency and a training termination condition, wherein the learning rate is the adjustment range and adjustment direction of parameters in a feature extraction formula of the picture recommendation model, the training frequency is the maximum training frequency of the picture recommendation model, the training termination condition is the condition information for terminating the training of the picture recommendation model, and if the training termination condition is reached or the preset training frequency is reached, the training of the picture recommendation model is terminated.
For example, in a preset set of training parameters, the learning rate is adjusted by 2%, the adjusting direction is amplified and adjusted, the training times are 15 times, and the training termination condition is that the difference between the matching probabilities obtained by two training before and after is less than 3%.
In one embodiment, as shown in fig. 4, step S103 includes substeps S1031, S1032, and S1033.
S1031, carrying out feature extraction on the plurality of training pictures according to the feature extraction formula to obtain feature variables of all the training pictures.
And carrying out feature extraction on the plurality of training pictures according to a preset feature extraction formula to obtain feature variables of all the training pictures. In the process of training the picture recommendation model, all training pictures and all candidate pictures in the candidate picture set are used as model training pictures, all training pictures are used as positive samples in the model training pictures, and pictures in the candidate picture set are used as negative samples in the model training pictures.
S1032, acquiring a preset group of training parameters and feature variables of all training pictures, performing multiple training on the established picture recommendation model, and taking the accuracy of the training pictures in the last training as the model accuracy of the group of training parameters.
And acquiring a preset group of training parameters and feature variables of all training pictures, performing multiple training on the established picture recommendation model, and taking the accuracy of the training pictures in the last training as the model accuracy of the group of training parameters. Specifically, a preset group of training parameters are obtained to adjust parameters in a feature extraction formula in the picture recommendation model, and feature variables of all training pictures are extracted again according to the adjusted feature extraction formula. Calculating the matching probability of a certain training picture and all model training pictures through a characteristic matching formula preset in a picture recommendation model, selecting the model training picture with the highest matching probability with the training picture as a training target picture, judging whether the training target picture obtained by matching is the training picture, and if the training target picture obtained by matching is the training picture, judging that the matching result of the training picture is successful; if the training target picture obtained by matching is not the training picture, the matching result of the training picture is a matching failure, the matching results of all the training pictures are counted, and the probability of successful matching of the training picture in the matching results is the accuracy of the training picture in the training. The model training pictures comprise all training pictures and all candidate pictures in the candidate picture set.
For example, 100 preset training pictures are used, all training pictures are matched with all model training pictures through a picture recommendation model, 78 training pictures are matched with the training pictures in 100 training pictures, and 22 training pictures are not matched with the training pictures in the training picture, so that the accuracy of the training pictures in the training is 78%.
And re-adjusting parameters of a feature extraction formula in the picture recommendation model according to the accuracy of the training pictures obtained by the first training and the set of training parameters, re-matching all the training pictures with all the model training pictures according to the adjusted picture recommendation model, and repeatedly executing the training process until reaching a training termination condition or reaching a preset training frequency, terminating training of the picture recommendation model, and obtaining the accuracy of the training pictures in the last training process as the model accuracy of the set of training parameters.
The preset multiple groups of training parameters are sequentially input into the picture recommendation model to train through the method, and the model accuracy of all the training parameters is obtained.
S1033, selecting an optimal group of training parameters according to the model accuracy of the obtained groups of training parameters, and setting parameters of a feature extraction formula in the picture recommendation model to obtain the trained picture recommendation model.
And selecting an optimal group of training parameters according to the model accuracy of the obtained multiple groups of training parameters, namely selecting a group of training parameters with the highest model accuracy, and setting parameters of a feature extraction formula in the picture recommendation model to obtain the trained picture recommendation model. Specifically, a group of training parameters with highest model accuracy is selected, and parameters of a feature extraction formula obtained in the last training process of the group of training parameters when the picture recommendation model is trained are used as parameters of the feature extraction formula in the trained picture recommendation model to be set.
And S104, if the pictures to be matched input by the user are received, matching the pictures to be matched with the candidate picture sets according to the trained picture recommendation model, and calculating to obtain the matching probability of the corresponding candidate pictures.
And if the pictures to be matched input by the user are received, matching the pictures to be matched with the candidate picture sets according to the trained picture recommendation model, and calculating the matching probability of the corresponding candidate pictures through a feature matching formula.
In one embodiment, as shown in FIG. 5, step S104 includes sub-steps S1041, S1042, S1043, and S1044.
S1041, extracting the characteristics of the pictures to be matched according to the characteristic extraction formula to obtain the characteristic variables of the pictures to be matched.
Specifically, feature extraction is carried out on the pictures to be matched according to a feature extraction formula of the trained picture recommendation model, so that feature variables of the pictures to be matched are obtained.
And S1042, calculating according to the characteristic variable of the picture to be matched and the characteristic variable values of the centroids in the candidate picture sets to obtain a target candidate picture set.
And calculating according to the characteristic variable of the picture to be matched and the characteristic variable values of the centroids in the candidate picture sets to obtain a target candidate picture set. Each candidate picture set corresponds to a specific group, each group comprises a mass center, specifically, the distance between the characteristic variable of the picture to be matched and the characteristic variable value of the mass center in each candidate picture set is calculated, and the candidate picture set corresponding to the mass center closest to the picture to be matched in all the mass centers is obtained as a target candidate picture set according to the calculation result.
S1043, extracting the characteristics of the candidate pictures in the target candidate picture set according to the characteristic extraction formula to obtain the characteristic variables of the candidate pictures in the target candidate picture set.
And extracting the characteristics of the candidate pictures in the target candidate picture set according to the characteristic extraction formula of the trained picture recommendation model so as to obtain the characteristic variables of all the candidate pictures in the target candidate picture set.
S1044, calculating the matching probability of the candidate pictures in the target candidate picture set and the pictures to be matched according to the characteristic matching formula so as to obtain the matching probability of all the candidate pictures.
And calculating the matching probability of the feature variables of all candidate pictures in the target candidate picture set and the feature variables of the pictures to be matched according to the feature matching formula so as to obtain the matching probability of all candidate pictures in the candidate picture set.
S105, sorting the obtained matching probabilities of all the candidate pictures, and obtaining target pictures according to the preset number of the target pictures.
And sequencing the matching probabilities of all the obtained candidate pictures, and obtaining target pictures according to the preset number of the target pictures so as to recommend the target pictures to a user. The number of the preset target pictures is the number information of the target pictures preset by the user, the target pictures are obtained according to the matching probability of all the candidate pictures in the target candidate picture set, and the target pictures are obtained according to the number of the target pictures preset by the user. For example, if the number of target pictures preset by the user is 10, according to the sorting result of the matching probabilities of the candidate pictures in the target candidate picture set, selecting 10 candidate pictures with the highest matching probability of all the candidate pictures as the target pictures to output. Specifically, in the process of outputting the target picture, basic information of the target picture can be output, wherein the basic information of the target picture comprises the time for issuing the target picture, the website for acquiring the target picture, the name of the target picture, the tag information of the target picture and the like.
The candidate pictures are classified into a plurality of candidate picture sets, a picture recommendation model is established according to the candidate picture sets, the picture recommendation model is trained through preset training parameters and training pictures, and a target picture with the highest matching probability is obtained through matching according to the trained picture recommendation model and is output, so that the pictures input by a user can be accurately matched to obtain similar pictures, errors in the picture matching process are greatly reduced, and matching time is saved.
The embodiment of the invention also provides a picture recommending device which is used for executing any embodiment of the picture recommending method. Specifically, referring to fig. 6, fig. 6 is a schematic block diagram of a picture recommendation device according to an embodiment of the present invention. The picture recommendation apparatus 100 may be configured in a management server.
As shown in fig. 6, the picture recommendation apparatus 100 includes a picture classification unit 101, a picture recommendation model construction unit 102, a picture recommendation model training unit 103, a matching probability calculation unit 104, and a target picture acquisition unit 105.
The picture classifying unit 101 is configured to obtain a plurality of pre-stored candidate pictures, and classify the candidate pictures according to a preset picture classifying rule to obtain a plurality of candidate picture sets.
The server side stores a plurality of candidate pictures in advance, and classifies the candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets. The server side is the enterprise terminal for constructing and using the picture recommendation model. And classifying all the candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets. The picture classification rule is rule information for classifying candidate pictures, wherein the picture classification rule comprises a feature extraction formula and a K-means clustering algorithm.
In other embodiments of the present invention, as shown in fig. 7, the image recommending apparatus 100 further includes a subunit: the candidate picture format adjustment unit 101A.
The candidate picture format adjustment unit 101A is configured to adjust formats of all the candidate pictures stored in advance according to a preset format adjustment rule to obtain candidate pictures with uniform formats.
Because the pre-stored candidate pictures cannot ensure complete unification of the formats, the formats of all the pre-stored candidate pictures can be uniformly adjusted according to preset format adjustment rules before classifying the candidate pictures.
In other embodiments of the present invention, as shown in fig. 8, the picture classifying unit 101 includes a subunit: a candidate picture feature variable extraction unit 1011, a clustering unit 1012, and a candidate picture classification unit 1013.
And the candidate picture feature variable extraction unit 1011 is configured to perform feature extraction on the candidate pictures according to a preset feature extraction formula to obtain feature variables of all candidate pictures.
And extracting the feature variables of all the candidate pictures according to a preset feature extraction formula. The preset feature extraction formula is constructed based on a convolutional neural network. The preset feature extraction formula comprises a first convolution calculation formula, a pooling calculation formula, a second convolution calculation formula, a first full-connection calculation formula and a second full-connection calculation formula. And extracting feature variables of all candidate pictures through a feature extraction formula. The feature variables of the candidate pictures are multidimensional vectors which are obtained after feature extraction of the pictures and used for reflecting the characteristics of the pictures, and the computer program cannot identify different pictures, but after converting the pictures into the feature variables, the computer program can identify the different pictures by analyzing the feature variables of the pictures.
Specifically, if the resolution of the input candidate picture is 200×200, according to the first convolution calculation formula, taking the resolution of 10×10 as a window and the step length of 1, performing convolution operation to obtain a vector matrix with the size of 190×190, namely, shallow features of the candidate picture; according to a pooling calculation formula, taking the resolution of 10 multiplied by 10 as a window, taking the step length as 10, and carrying out downsampling to obtain a vector matrix with the size of 18 multiplied by 18, namely, the deep-level feature of the candidate picture; and performing convolution operation with the resolution of 2 multiplied by 2 as a window and the step length of 2 according to a second convolution calculation formula to obtain a vector matrix with the size of 9 multiplied by 9. Calculating the obtained 9×9 vector matrix by a first full-connection calculation formula, wherein the first full-connection formula contains five nodes, each node is associated with the 9×9 vector matrix, that is, the values of five nodes associated with the 9×9 vector matrix are calculated by five calculation formulas respectively, the first calculation formula can be expressed as c1=w1×x1+b1, wherein C1 is the calculated value of the first node, x1 is the value of the candidate picture vector matrix, W1 and B1 are the preset parameter values in the first calculation formula associated with the first node and the vector matrix, and the values of five nodes associated with the vector matrix can be calculated by the five calculation formulas; calculating the values of the five nodes through a second full-connection calculation formula to obtain a characteristic variable of the final candidate picture, wherein the calculation formula is F1=a1×C1+a2×C2+a3×C3+a4×C4+a5×C5; wherein C1, C2, C3, C4, C5 are values of five nodes associated with the vector matrix of the candidate picture, a1, a2, a3, a4, a5 are preset parameter values from five nodes to a final output node, and finally, the feature variable of the candidate picture is a vector matrix of 1×128 dimensions, which can be represented by f1= (F1, F2 … … F128).
According to the characteristic extraction formula, characteristic extraction can be carried out on all candidate pictures to obtain characteristic variables of all candidate pictures, namely F1, F2 and F3 … … Fn.
And the clustering unit 1012 is used for clustering the characteristic variables of the candidate pictures according to a preset K-means clustering algorithm to obtain a plurality of groups containing centroids.
And clustering the characteristic variables of the candidate pictures according to a preset K-means clustering algorithm to comprise clustering results of a plurality of groups. Specifically, the number K of finally required groups is set in a K-means clustering algorithm, and feature variables of all candidate pictures are clustered according to the numerical value of K, so that feature variable values of mass centers of each group in the K groups are obtained. The centroid is the center point in the group, and the characteristic variable value of the centroid is the mean value of the characteristic variables of the group.
The candidate picture classifying unit 1013 is configured to classify all candidate pictures according to the obtained plurality of class groups to obtain a plurality of candidate picture sets including the candidate pictures.
And classifying all the candidate pictures according to the obtained multiple groups to obtain multiple candidate picture sets containing the candidate pictures. Because each cluster after clustering contains a characteristic variable value as the mass center of the cluster, a mass center closest to the candidate picture can be obtained by calculating the distance between the candidate picture and all the mass centers, and the candidate picture is classified into the cluster corresponding to the mass center. After classifying all candidate pictures according to the method, a plurality of candidate picture sets containing corresponding candidate pictures can be obtained.
The picture recommendation model construction unit 102 is configured to establish a picture recommendation model according to a preset feature matching formula and the obtained plurality of candidate picture sets.
And establishing a picture recommendation model according to a preset feature matching formula and the obtained multiple candidate picture sets. In order to recognize the picture input by the user and calculate the matching probability of the picture input by the user and the candidate pictures, a picture recommendation model is established through a preset feature matching formula and a plurality of obtained candidate picture sets. Specifically, the preset feature matching formula is s=1/(((f 1-t 1) 2+ (f 2-t 2) 2+ … … + (fn-tn) 2) -1+1), where f1 and f2 … … fn are feature variable values of a certain candidate picture, t1 and t2 … … tn are feature variable values of a picture input by a user, and n=128 in the above formula because the feature variable of the candidate picture is a vector matrix of 1×128 dimensions.
The picture recommendation model training unit 103 is configured to train the established picture recommendation model through a preset plurality of sets of training parameters and a preset plurality of training pictures to obtain a trained picture recommendation model.
And training the established picture recommendation model through a plurality of preset training parameters and a plurality of preset training pictures to obtain a trained picture recommendation model. Specifically, each set of training parameters includes a learning rate, a training frequency and a training termination condition, wherein the learning rate is the adjustment range and adjustment direction of parameters in a feature extraction formula of the picture recommendation model, the training frequency is the maximum training frequency of the picture recommendation model, the training termination condition is the condition information for terminating the training of the picture recommendation model, and if the training termination condition is reached or the preset training frequency is reached, the training of the picture recommendation model is terminated.
In other embodiments of the present invention, as shown in fig. 9, the image recommendation model training unit 103 includes a subunit: a training picture feature variable extraction unit 1031, a model accuracy acquisition unit 1032, and a parameter setting unit 1033.
The training picture feature variable extraction unit 1031 is configured to perform feature extraction on a plurality of training pictures according to the feature extraction formula to obtain feature variables of all the training pictures.
And carrying out feature extraction on the plurality of training pictures according to a preset feature extraction formula to obtain feature variables of all the training pictures. In the process of training the picture recommendation model, all training pictures and all candidate pictures in the candidate picture set are used as model training pictures, all training pictures are used as positive samples in the model training pictures, and pictures in the candidate picture set are used as negative samples in the model training pictures.
The model accuracy obtaining unit 1032 is configured to obtain a preset set of training parameters and feature variables of all training pictures, perform multiple training on the built picture recommendation model, and take the accuracy of the training picture in the last training as the model accuracy of the set of training parameters.
And acquiring a preset group of training parameters and feature variables of all training pictures, performing multiple training on the established picture recommendation model, and taking the accuracy of the training pictures in the last training as the model accuracy of the group of training parameters. Specifically, a preset group of training parameters are obtained to adjust parameters in a feature extraction formula in the picture recommendation model, and feature variables of all training pictures are extracted again according to the adjusted feature extraction formula. Calculating the matching probability of a certain training picture and all model training pictures through a characteristic matching formula preset in a picture recommendation model, selecting the model training picture with the highest matching probability with the training picture as a training target picture, judging whether the training target picture obtained by matching is the training picture, and if the training target picture obtained by matching is the training picture, judging that the matching result of the training picture is successful; if the training target picture obtained by matching is not the training picture, the matching result of the training picture is a matching failure, the matching results of all the training pictures are counted, and the probability of successful matching of the training picture in the matching results is the accuracy of the training picture in the training. The model training pictures comprise all training pictures and all candidate pictures in the candidate picture set.
And re-adjusting parameters of a feature extraction formula in the picture recommendation model according to the accuracy of the training pictures obtained by the first training and the set of training parameters, re-matching all the training pictures with all the model training pictures according to the adjusted picture recommendation model, and repeatedly executing the training process until reaching a training termination condition or reaching a preset training frequency, terminating training of the picture recommendation model, and obtaining the accuracy of the training pictures in the last training process as the model accuracy of the set of training parameters.
The preset multiple groups of training parameters are sequentially input into the picture recommendation model to train through the method, and the model accuracy of all the training parameters is obtained.
And the parameter setting unit 1033 is configured to select an optimal set of training parameters according to the model accuracy of the obtained plurality of sets of training parameters, and set parameters of a feature extraction formula in the picture recommendation model to obtain a trained picture recommendation model.
And selecting an optimal group of training parameters according to the model accuracy of the obtained multiple groups of training parameters, namely selecting a group of training parameters with the highest model accuracy, and setting parameters of a feature extraction formula in the picture recommendation model to obtain the trained picture recommendation model. Specifically, a group of training parameters with highest model accuracy is selected, and parameters of a feature extraction formula obtained in the last training process of the group of training parameters when the picture recommendation model is trained are used as parameters of the feature extraction formula in the trained picture recommendation model to be set.
And the matching probability calculation unit 104 is configured to, if receiving the picture to be matched input by the user, match the picture to be matched with the plurality of candidate picture sets according to the trained picture recommendation model, and calculate a matching probability of the corresponding candidate picture.
And if the pictures to be matched input by the user are received, matching the pictures to be matched with the candidate picture sets according to the trained picture recommendation model, and calculating the matching probability of the corresponding candidate pictures through a feature matching formula.
In other embodiments of the present invention, as shown in fig. 10, the matching probability calculation unit 104 includes a subunit: a to-be-matched picture feature extraction unit 1041, a candidate picture set acquisition unit 1042, a feature variable extraction unit 1043, and a candidate picture matching probability calculation unit 1044.
And a picture to be matched feature extraction unit 1041, configured to perform feature extraction on a picture to be matched according to the feature extraction formula to obtain feature variables of the picture to be matched.
Specifically, feature extraction is carried out on the pictures to be matched according to a feature extraction formula of the trained picture recommendation model, so that feature variables of the pictures to be matched are obtained.
The candidate picture set obtaining unit 1042 is used for calculating according to the feature variable of the picture to be matched and the feature variable values of the centroids in the plurality of candidate picture sets to obtain the target candidate picture set.
And calculating according to the characteristic variable of the picture to be matched and the characteristic variable values of the centroids in the candidate picture sets to obtain a target candidate picture set. Each candidate picture set corresponds to a specific group, each group comprises a mass center, specifically, the distance between the characteristic variable of the picture to be matched and the characteristic variable value of the mass center in each candidate picture set is calculated, and the candidate picture set corresponding to the mass center closest to the picture to be matched in all the mass centers is obtained as a target candidate picture set according to the calculation result.
The feature variable extraction unit 1043 is configured to perform feature extraction on the candidate pictures in the target candidate picture set according to the feature extraction formula to obtain feature variables of the candidate pictures in the target candidate picture set.
And extracting the characteristics of the candidate pictures in the target candidate picture set according to the characteristic extraction formula of the trained picture recommendation model so as to obtain the characteristic variables of all the candidate pictures in the target candidate picture set.
The candidate picture matching probability calculation unit 1044 is configured to calculate the matching probabilities of the candidate pictures in the target candidate picture set and the pictures to be matched according to the feature matching formula so as to obtain the matching probabilities of all the candidate pictures.
And calculating the matching probability of the feature variables of all candidate pictures in the target candidate picture set and the feature variables of the pictures to be matched according to the feature matching formula so as to obtain the matching probability of all candidate pictures in the candidate picture set.
The target picture obtaining unit 105 is configured to sort the obtained matching probabilities of all candidate pictures, and obtain target pictures according to a preset target picture number.
And sequencing the matching probabilities of all the obtained candidate pictures, and obtaining target pictures according to the preset number of the target pictures so as to recommend the target pictures to a user. The number of the preset target pictures is the number information of the target pictures preset by the user, the target pictures are obtained according to the matching probability of all the candidate pictures in the target candidate picture set, and the target pictures are obtained according to the number of the target pictures preset by the user. Specifically, in the process of outputting the target picture, basic information of the target picture can be output, wherein the basic information of the target picture comprises the time for issuing the target picture, the website for acquiring the target picture, the name of the target picture, the tag information of the target picture and the like.
The candidate pictures are classified into a plurality of candidate picture sets, a picture recommendation model is established according to the candidate picture sets, the picture recommendation model is trained through preset training parameters and training pictures, and a target picture with the highest matching probability is obtained through matching according to the trained picture recommendation model and is output, so that the pictures input by a user can be accurately matched to obtain similar pictures, errors in the picture matching process are greatly reduced, and matching time is saved.
The picture recommendation apparatus described above may be implemented in the form of a computer program which may be run on a computer device as shown in fig. 11.
Referring to fig. 11, fig. 11 is a schematic block diagram of a computer device according to an embodiment of the present invention.
With reference to FIG. 11, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform a picture recommendation method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the non-volatile storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform a picture recommendation method.
The network interface 505 is used for network communication, such as providing for transmission of data information, etc. It will be appreciated by those skilled in the art that the structure shown in FIG. 11 is merely a block diagram of some of the structures associated with the present inventive arrangements and does not constitute a limitation of the computer device 500 to which the present inventive arrangements may be applied, and that a particular computer device 500 may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
Wherein the processor 502 is configured to execute a computer program 5032 stored in a memory to perform the following functions: acquiring a plurality of pre-stored candidate pictures, and classifying the candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets; establishing a picture recommendation model according to a preset feature matching formula and a plurality of obtained candidate picture sets; training the established picture recommendation model through a plurality of preset training parameters and a plurality of preset training pictures to obtain a trained picture recommendation model; if the pictures to be matched input by the user are received, matching the pictures to be matched with a plurality of candidate picture sets according to the trained picture recommendation model, and calculating to obtain matching probability of the corresponding candidate pictures; and sequencing the obtained matching probabilities of all the candidate pictures, and obtaining target pictures according to the preset number of the target pictures.
In one embodiment, when the processor 502 performs the step of acquiring a plurality of pre-stored candidate pictures and classifying the candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets, the following operations are performed: performing feature extraction on the candidate pictures according to a preset feature extraction formula to obtain feature variables of all the candidate pictures; clustering the characteristic variables of the candidate pictures according to a preset K-means clustering algorithm to obtain a plurality of groups containing mass centers; and classifying all the candidate pictures according to the obtained multiple groups to obtain multiple candidate picture sets containing the candidate pictures.
In one embodiment, the processor 502 performs the following operations when performing the step of training the built picture recommendation model through the preset plurality of sets of training parameters and the preset plurality of training pictures to obtain the trained picture recommendation model: performing feature extraction on a plurality of training pictures according to the feature extraction formula to obtain feature variables of all the training pictures; acquiring a preset group of training parameters and feature variables of all training pictures, performing multiple training on the established picture recommendation model, and taking the accuracy of the training pictures in the last training as the model accuracy of the group of training parameters; and selecting an optimal group of training parameters according to the model accuracy of the obtained multiple groups of training parameters, and setting parameters of a feature extraction formula in the picture recommendation model to obtain the trained picture recommendation model.
In an embodiment, when the processor 502 performs the steps of matching the picture to be matched with the plurality of candidate picture sets according to the trained picture recommendation model if the picture to be matched input by the user is received, and calculating the matching probability of the corresponding candidate picture, the following operations are performed: extracting the characteristics of the pictures to be matched according to the characteristic extraction formula to obtain characteristic variables of the pictures to be matched; calculating according to the characteristic variable of the picture to be matched and the characteristic variable values of the centroids in the candidate picture sets to obtain a target candidate picture set; extracting the characteristics of the candidate pictures in the target candidate picture set according to the characteristic extraction formula to obtain characteristic variables of the candidate pictures in the target candidate picture set; and calculating the matching probability of the candidate pictures in the target candidate picture set and the pictures to be matched according to the characteristic matching formula so as to obtain the matching probability of all the candidate pictures.
In an embodiment, before executing the step of acquiring a plurality of pre-stored candidate pictures and classifying the candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets, the processor 502 further executes the following operations: and adjusting the formats of all the pre-stored candidate pictures according to a preset format adjustment rule to obtain candidate pictures with uniform formats.
Those skilled in the art will appreciate that the embodiment of the computer device shown in fig. 11 is not limiting of the specific construction of the computer device, and in other embodiments, the computer device may include more or less components than those shown, or certain components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may include only a memory and a processor, and in such embodiments, the structure and function of the memory and the processor are consistent with the embodiment shown in fig. 11, and will not be described again.
It should be appreciated that in embodiments of the present invention, the processor 502 may be a central processing unit (CentralProcessing Unit, CPU), the processor 502 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific IntegratedCircuit, ASIC), off-the-shelf Programmable gate arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In another embodiment of the invention, a computer-readable storage medium is provided. The computer readable storage medium may be a non-volatile storage medium. The computer readable storage medium stores a computer program, wherein the computer program when executed by a processor performs the steps of: acquiring a plurality of pre-stored candidate pictures, and classifying the candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets; establishing a picture recommendation model according to a preset feature matching formula and a plurality of obtained candidate picture sets; training the established picture recommendation model through a plurality of preset training parameters and a plurality of preset training pictures to obtain a trained picture recommendation model; if the pictures to be matched input by the user are received, matching the pictures to be matched with a plurality of candidate picture sets according to the trained picture recommendation model, and calculating to obtain matching probability of the corresponding candidate pictures; and sequencing the obtained matching probabilities of all the candidate pictures, and obtaining target pictures according to the preset number of the target pictures.
In an embodiment, the step of obtaining a plurality of pre-stored candidate pictures and classifying the candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets includes: performing feature extraction on the candidate pictures according to a preset feature extraction formula to obtain feature variables of all the candidate pictures; clustering the characteristic variables of the candidate pictures according to a preset K-means clustering algorithm to obtain a plurality of groups containing mass centers; and classifying all the candidate pictures according to the obtained multiple groups to obtain multiple candidate picture sets containing the candidate pictures.
In an embodiment, the step of training the built picture recommendation model through a preset plurality of sets of training parameters and a preset plurality of training pictures to obtain a trained picture recommendation model includes: performing feature extraction on a plurality of training pictures according to the feature extraction formula to obtain feature variables of all the training pictures; acquiring a preset group of training parameters and feature variables of all training pictures, performing multiple training on the established picture recommendation model, and taking the accuracy of the training pictures in the last training as the model accuracy of the group of training parameters; and selecting an optimal group of training parameters according to the model accuracy of the obtained multiple groups of training parameters, and setting parameters of a feature extraction formula in the picture recommendation model to obtain the trained picture recommendation model.
In an embodiment, the step of matching the picture to be matched with the plurality of candidate picture sets according to the trained picture recommendation model and calculating the matching probability of the corresponding candidate picture if the picture to be matched input by the user is received includes: extracting the characteristics of the pictures to be matched according to the characteristic extraction formula to obtain characteristic variables of the pictures to be matched; calculating according to the characteristic variable of the picture to be matched and the characteristic variable values of the centroids in the candidate picture sets to obtain a target candidate picture set; extracting the characteristics of the candidate pictures in the target candidate picture set according to the characteristic extraction formula to obtain characteristic variables of the candidate pictures in the target candidate picture set; and calculating the matching probability of the candidate pictures in the target candidate picture set and the pictures to be matched according to the characteristic matching formula so as to obtain the matching probability of all the candidate pictures.
In an embodiment, before the step of obtaining the pre-stored plurality of candidate pictures and classifying the candidate pictures according to the preset picture classification rule to obtain the plurality of candidate picture sets, the method further includes: and adjusting the formats of all the pre-stored candidate pictures according to a preset format adjustment rule to obtain candidate pictures with uniform formats.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus, device and unit described above may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein. Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the units is merely a logical function division, there may be another division manner in actual implementation, or units having the same function may be integrated into one unit, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or elements, or may be an electrical, mechanical, or other form of connection.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment of the present invention.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units may be stored in a storage medium if implemented in the form of software functional units and sold or used as stand-alone products. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (7)

1. A picture recommendation method, comprising:
acquiring a plurality of pre-stored candidate pictures, and classifying the candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets;
establishing a picture recommendation model according to a preset feature matching formula and a plurality of obtained candidate picture sets;
training the established picture recommendation model through a plurality of preset training parameters and a plurality of preset training pictures to obtain a trained picture recommendation model;
if the pictures to be matched input by the user are received, matching the pictures to be matched with a plurality of candidate picture sets according to the trained picture recommendation model, and calculating to obtain matching probability of the corresponding candidate pictures;
sorting the obtained matching probabilities of all candidate pictures, and obtaining target pictures according to the number of preset target pictures;
The classifying the candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets includes:
performing feature extraction on the candidate pictures according to a preset feature extraction formula to obtain feature variables of all the candidate pictures;
clustering the characteristic variables of the candidate pictures according to a preset K-means clustering algorithm to obtain a plurality of groups containing mass centers;
classifying all candidate pictures according to the obtained multiple groups to obtain multiple candidate picture sets containing the candidate pictures;
matching the picture to be matched with a plurality of candidate picture sets according to the trained picture recommendation model to obtain the matching probability of the corresponding candidate pictures, including:
extracting the characteristics of the pictures to be matched according to the characteristic extraction formula to obtain characteristic variables of the pictures to be matched;
calculating according to the characteristic variable of the picture to be matched and the characteristic variable values of the centroids in the candidate picture sets to obtain a target candidate picture set;
extracting the characteristics of the candidate pictures in the target candidate picture set according to the characteristic extraction formula to obtain characteristic variables of the candidate pictures in the target candidate picture set;
calculating the matching probability of the candidate pictures in the target candidate picture set and the pictures to be matched according to the characteristic matching formula to obtain the matching probability of all the candidate pictures; the feature matching formula is S=1/(((f 1-t 1)) 2 +(f2-t2) 2 +……+(fn-tn) 2 ) -1 +1), wherein f1, f2 … … fn are characteristic variable values of a certain candidate picture in the target candidate picture set, and t1, t2 … … tn are characteristic variable values of pictures to be matched input by a user.
2. The picture recommendation method according to claim 1, wherein the training the built picture recommendation model through the preset plurality of sets of training parameters and the preset plurality of training pictures to obtain a trained picture recommendation model includes:
performing feature extraction on a plurality of training pictures according to the feature extraction formula to obtain feature variables of all the training pictures;
acquiring a preset group of training parameters and feature variables of all training pictures, performing multiple training on the established picture recommendation model, and taking the accuracy of the training pictures in the last training as the model accuracy of the group of training parameters;
and selecting an optimal group of training parameters according to the model accuracy of the obtained multiple groups of training parameters, and setting parameters of a feature extraction formula in the picture recommendation model to obtain the trained picture recommendation model.
3. The picture recommendation method according to claim 1, wherein before the obtaining a plurality of pre-stored candidate pictures and classifying the candidate pictures according to a preset picture classification rule to obtain a plurality of candidate picture sets, further comprises:
And adjusting the formats of all the pre-stored candidate pictures according to a preset format adjustment rule to obtain candidate pictures with uniform formats.
4. A picture recommendation apparatus, characterized by comprising:
the picture classifying unit is used for acquiring a plurality of pre-stored candidate pictures and classifying the candidate pictures according to a preset picture classifying rule to obtain a plurality of candidate picture sets;
the picture recommendation model construction unit is used for constructing a picture recommendation model according to a preset feature matching formula and a plurality of obtained candidate picture sets;
the picture recommendation model training unit is used for training the established picture recommendation model through a plurality of preset training parameters and a plurality of preset training pictures to obtain a trained picture recommendation model;
the matching probability calculation unit is used for matching the picture to be matched with the plurality of candidate picture sets according to the trained picture recommendation model if the picture to be matched input by the user is received, and calculating the matching probability of the corresponding candidate picture;
the target picture acquisition unit is used for sequencing the obtained matching probabilities of all candidate pictures and acquiring target pictures according to the preset number of target pictures;
The picture classifying unit includes:
the candidate picture feature variable extraction unit is used for carrying out feature extraction on the candidate pictures according to a preset feature extraction formula so as to obtain feature variables of all the candidate pictures;
the clustering unit is used for clustering the characteristic variables of the candidate pictures according to a preset K-means clustering algorithm to obtain a plurality of groups containing mass centers;
the candidate picture classifying unit is used for classifying all candidate pictures according to the obtained multiple groups to obtain multiple candidate picture sets containing the candidate pictures;
the matching probability calculation unit includes a subunit: the image feature extraction unit to be matched is used for extracting the features of the images to be matched according to the feature extraction formula to obtain feature variables of the images to be matched; the candidate picture set acquisition unit is used for calculating according to the characteristic variable of the picture to be matched and the characteristic variable values of the centroids in the plurality of candidate picture sets to obtain a target candidate picture set; the feature variable extraction unit is used for extracting features of the candidate pictures in the target candidate picture set according to the feature extraction formula so as to obtain feature variables of the candidate pictures in the target candidate picture set; the candidate picture matching probability calculation unit is used for calculating the matching probability of the candidate pictures in the target candidate picture set and the pictures to be matched according to the characteristic matching formula so as to obtain the matching probability of all the candidate pictures; the feature matching formula is S=1/(((f 1-t 1)) 2 +(f2-t2) 2 +……+(fn-tn) 2 ) -1 +1), wherein f1, f2 … … fn are characteristic variable values of a certain candidate picture in the target candidate picture set, and t1, t2 … … tn are characteristic variable values of pictures to be matched input by a user.
5. The picture recommendation device according to claim 4, wherein the picture recommendation model training unit comprises:
the training picture feature variable extraction unit is used for carrying out feature extraction on a plurality of training pictures according to the feature extraction formula so as to obtain feature variables of all the training pictures;
the model accuracy obtaining unit is used for obtaining a preset group of training parameters and characteristic variables of all training pictures, carrying out multiple training on the established picture recommendation model, and taking the accuracy of the training pictures in the last training as the model accuracy of the group of training parameters;
and the parameter setting unit is used for selecting an optimal group of training parameters according to the model accuracy of the obtained multiple groups of training parameters and setting parameters of a feature extraction formula in the picture recommendation model to obtain the trained picture recommendation model.
6. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the picture recommendation method according to any one of claims 1 to 3 when executing the computer program.
7. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, causes the processor to perform the picture recommendation method according to any one of claims 1 to 3.
CN201811106466.4A 2018-09-21 2018-09-21 Picture recommendation method and device, computer equipment and storage medium Active CN109241318B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201811106466.4A CN109241318B (en) 2018-09-21 2018-09-21 Picture recommendation method and device, computer equipment and storage medium
PCT/CN2018/124798 WO2020056999A1 (en) 2018-09-21 2018-12-28 Picture recommendation method and apparatus, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811106466.4A CN109241318B (en) 2018-09-21 2018-09-21 Picture recommendation method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109241318A CN109241318A (en) 2019-01-18
CN109241318B true CN109241318B (en) 2023-06-13

Family

ID=65056387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811106466.4A Active CN109241318B (en) 2018-09-21 2018-09-21 Picture recommendation method and device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN109241318B (en)
WO (1) WO2020056999A1 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110232401B (en) * 2019-05-05 2023-08-04 平安科技(深圳)有限公司 Focus judging method, device and computer equipment based on picture conversion
CN110457469A (en) * 2019-07-05 2019-11-15 中国平安财产保险股份有限公司 Information classification approach, device based on shot and long term memory network, computer equipment
CN110533050B (en) * 2019-07-22 2023-11-24 平安科技(深圳)有限公司 Picture geographic information acquisition method and device, computer equipment and storage medium
CN111461228B (en) * 2020-04-01 2024-03-15 腾讯科技(深圳)有限公司 Image recommendation method and device and storage medium
CN112069337A (en) * 2020-09-03 2020-12-11 Oppo广东移动通信有限公司 Picture processing method and device, electronic equipment and storage medium
CN112558958B (en) * 2020-12-16 2023-07-25 中国平安人寿保险股份有限公司 Template-based push content generation method and device and computer equipment
CN112766288B (en) * 2021-03-03 2024-01-23 重庆赛迪奇智人工智能科技有限公司 Image processing model construction method, device, electronic equipment and readable storage medium
CN113792202B (en) * 2021-08-31 2023-05-05 中国电子科技集团公司第三十研究所 User classification screening method
CN113769387A (en) * 2021-09-18 2021-12-10 网易(杭州)网络有限公司 Game graphic parameter configuration method and device and terminal equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8429173B1 (en) * 2009-04-20 2013-04-23 Google Inc. Method, system, and computer readable medium for identifying result images based on an image query
CN105045818A (en) * 2015-06-26 2015-11-11 腾讯科技(深圳)有限公司 Picture recommending method, apparatus and system
US9373057B1 (en) * 2013-11-01 2016-06-21 Google Inc. Training a neural network to detect objects in images

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101551809B (en) * 2009-05-13 2011-04-06 西安电子科技大学 Search method of SAR images classified based on Gauss hybrid model
US9373033B2 (en) * 2012-03-13 2016-06-21 Massachusetts Institute Of Technology Assisted surveillance of vehicles-of-interest
CN103914527B (en) * 2014-03-28 2017-02-15 西安电子科技大学 Graphic image recognition and matching method based on genetic programming algorithms of novel coding modes
CN106021362B (en) * 2016-05-10 2018-04-13 百度在线网络技术(北京)有限公司 Generation, image searching method and the device that the picture feature of query formulation represents
CN106202362A (en) * 2016-07-07 2016-12-07 Tcl集团股份有限公司 Image recommendation method and image recommendation device
CN106383912B (en) * 2016-10-14 2019-09-03 北京字节跳动网络技术有限公司 A kind of picture retrieval method and device
CN108509466A (en) * 2017-04-14 2018-09-07 腾讯科技(深圳)有限公司 A kind of information recommendation method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8429173B1 (en) * 2009-04-20 2013-04-23 Google Inc. Method, system, and computer readable medium for identifying result images based on an image query
US9373057B1 (en) * 2013-11-01 2016-06-21 Google Inc. Training a neural network to detect objects in images
CN105045818A (en) * 2015-06-26 2015-11-11 腾讯科技(深圳)有限公司 Picture recommending method, apparatus and system

Also Published As

Publication number Publication date
CN109241318A (en) 2019-01-18
WO2020056999A1 (en) 2020-03-26

Similar Documents

Publication Publication Date Title
CN109241318B (en) Picture recommendation method and device, computer equipment and storage medium
WO2020239015A1 (en) Image recognition method and apparatus, image classification method and apparatus, electronic device, and storage medium
WO2022048173A1 (en) Artificial intelligence-based customer intent identification method and apparatus, device, and medium
CN111898739B (en) Data screening model construction method, data screening method, device, computer equipment and storage medium based on meta learning
CN110856037B (en) Video cover determination method and device, electronic equipment and readable storage medium
CN111046879B (en) Certificate image classification method, device, computer equipment and readable storage medium
CN110991170B (en) Chinese disease name intelligent standardization method and system based on electronic medical record information
CN112561080A (en) Sample screening method, sample screening device and terminal equipment
CN111914159B (en) Information recommendation method and terminal
CN110750658B (en) Recommendation method of media resource, server and computer readable storage medium
CN112948612B (en) Human body cover generation method and device, electronic equipment and storage medium
CN113052245B (en) Image clustering method and device, electronic equipment and storage medium
CN107590460A (en) Face classification method, apparatus and intelligent terminal
CN110084232B (en) Method and device for recognizing Chinese characters in license plate and terminal equipment
CN110569924A (en) Icon processing method and device, readable storage medium and computer equipment
CN111159481B (en) Edge prediction method and device for graph data and terminal equipment
CN112994960B (en) Method and device for detecting business data abnormity and computing equipment
CN110928889A (en) Training model updating method, device and computer storage medium
CN113902944A (en) Model training and scene recognition method, device, equipment and medium
CN113920382A (en) Cross-domain image classification method based on class consistency structured learning and related device
CN110580483A (en) indoor and outdoor user distinguishing method and device
CN110210314B (en) Face detection method, device, computer equipment and storage medium
CN111369489B (en) Image identification method and device and terminal equipment
CN116567114A (en) Protocol analysis method, device, terminal equipment and storage medium
WO2022194049A1 (en) Object processing method and apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant