WO2020056999A1 - 图片推荐方法、装置、计算机设备及存储介质 - Google Patents

图片推荐方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2020056999A1
WO2020056999A1 PCT/CN2018/124798 CN2018124798W WO2020056999A1 WO 2020056999 A1 WO2020056999 A1 WO 2020056999A1 CN 2018124798 W CN2018124798 W CN 2018124798W WO 2020056999 A1 WO2020056999 A1 WO 2020056999A1
Authority
WO
WIPO (PCT)
Prior art keywords
picture
candidate
pictures
training
preset
Prior art date
Application number
PCT/CN2018/124798
Other languages
English (en)
French (fr)
Inventor
吴壮伟
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020056999A1 publication Critical patent/WO2020056999A1/zh

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

Definitions

  • the present application relates to the field of computer technology, and in particular, to a picture recommendation method, device, computer equipment, and storage medium.
  • the embodiments of the present application provide a picture recommendation method, device, computer equipment, and storage medium, which are aimed at solving the problem that similar pictures cannot be efficiently and accurately matched in the prior art.
  • an embodiment of the present application provides a picture recommendation method, including: obtaining a plurality of candidate pictures stored in advance, and classifying the candidate pictures according to a preset picture classification rule to obtain multiple candidate picture sets; Establish a picture recommendation model according to a preset feature matching formula and the obtained multiple candidate picture sets; train the established picture recommendation model through preset multiple sets of training parameters and preset multiple training pictures to obtain a trained Picture recommendation model; if a picture to be matched input by the user is received, the picture to be matched is matched with multiple candidate picture sets according to the trained picture recommendation model, and the matching probability of the corresponding candidate picture is calculated; for all the obtained candidates The matching probability of pictures is sorted, and a target picture is obtained according to a preset number of target pictures.
  • an embodiment of the present application provides a picture recommendation device, including: a picture classification unit, configured to obtain multiple stored candidate pictures in advance, and classify the candidate pictures according to a preset picture classification rule to obtain Multiple candidate picture sets; a picture recommendation model building unit for building a picture recommendation model according to a preset feature matching formula and the obtained multiple candidate picture sets; a picture recommendation model training unit for using a plurality of preset trainings Parameters and preset multiple training pictures to train the established picture recommendation model to obtain a trained picture recommendation model; a matching probability calculation unit for receiving a picture to be matched input by the user and recommending the picture based on the training The model matches the matching picture with multiple candidate picture sets and calculates the matching probability of the corresponding candidate picture; the target picture acquisition unit is used to sort the matching probability of all the obtained candidate pictures according to a preset number of target pictures Get the target picture.
  • an embodiment of the present application further provides a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer
  • the program implements the picture recommendation method described in the first aspect.
  • an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, causes the processor to execute the foregoing first The picture recommendation method described in one aspect.
  • FIG. 1 is a schematic flowchart of a picture recommendation method according to an embodiment of the present application
  • FIG. 2 is another schematic flowchart of a picture recommendation method according to an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a sub-flow of a picture recommendation method according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of another sub-process of a picture recommendation method according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of another sub-process of a picture recommendation method according to an embodiment of the present application.
  • FIG. 6 is a schematic block diagram of a picture recommendation device according to an embodiment of the present application.
  • FIG. 7 is another schematic block diagram of a picture recommendation device according to an embodiment of the present application.
  • FIG. 8 is a schematic block diagram of a subunit of a picture recommendation device according to an embodiment of the present application.
  • FIG. 9 is a schematic block diagram of another subunit of a picture recommendation device according to an embodiment of the present application.
  • FIG. 10 is a schematic block diagram of another subunit of a picture recommendation device according to an embodiment of the present application.
  • FIG. 11 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • FIG. 1 is a schematic flowchart of a picture recommendation method according to an embodiment of the present application.
  • the picture recommendation method is applied to a server side, and the method is executed by application software installed in the server side, wherein the server side is an enterprise terminal for performing a picture recommendation method to recommend similar pictures.
  • the method includes steps S101 to S105.
  • S101 Obtain multiple candidate pictures stored in advance, and classify the candidate pictures according to a preset picture classification rule to obtain multiple candidate picture sets.
  • the server stores multiple candidate pictures in advance, and classifies the candidate pictures according to a preset picture classification rule to obtain multiple candidate picture sets.
  • the server side is the enterprise terminal used to build and use the picture recommendation model. Classify all candidate pictures according to a preset picture classification rule to obtain multiple candidate picture sets.
  • Picture classification rules are rule information used to classify candidate pictures.
  • the picture classification rules include feature extraction formulas and K-means clustering algorithms.
  • step S101A further includes step S101A.
  • S101A Adjust the formats of all candidate pictures stored in advance according to a preset format adjustment rule to obtain candidate pictures with a uniform format.
  • the formats of all the pre-stored candidate pictures can be uniformly adjusted according to a preset format adjustment rule. For example, the size of all candidate pictures can be adjusted to adjust the resolution of all candidate pictures to 200 ⁇ 200, and a candidate picture with a uniform format can be obtained.
  • step S101 includes sub-steps S1011, S1012, and S1013.
  • Feature extraction is performed on the candidate pictures according to a preset feature extraction formula to obtain feature variables of all candidate pictures.
  • Feature variables of all candidate pictures are extracted according to a preset feature extraction formula.
  • a preset feature extraction formula is constructed based on a convolutional neural network.
  • the preset feature extraction formula includes a first convolution calculation formula, a pooling calculation formula, a second convolution calculation formula, a first fully connected calculation formula, and a second fully connected calculation formula.
  • the feature variables of all candidate pictures can be extracted through the feature extraction formula.
  • the feature variable of the candidate picture is a multi-dimensional vector reflecting the characteristics of the picture obtained after feature extraction of the picture.
  • the computer program cannot identify different pictures, but after converting multiple pictures into feature variables, the computer program passes By analyzing the characteristic variables of multiple pictures, different pictures can be identified.
  • the convolution operation is performed to obtain a size of 190 ⁇ 190 Vector matrix, which is the shallow feature of the candidate picture;
  • the pooling calculation formula with a resolution of 10 ⁇ 10 as the window and a step size of 10
  • downsampling is performed to obtain a vector matrix of size 18 ⁇ 18. That is, the deep-level features of the candidate picture;
  • a convolution operation is performed with a resolution of 2 ⁇ 2 as a window and a step size of 2 to obtain a vector matrix of size 9 ⁇ 9.
  • the 9 ⁇ 9 vector matrix is calculated through the first fully-connected calculation formula.
  • the first fully-connected formula contains a total of five nodes, and each node is associated with a 9 ⁇ 9 vector matrix, that is, respectively.
  • the values of the five nodes associated with the 9 ⁇ 9 vector matrix are calculated through five calculation formulas.
  • feature extraction can be performed on all candidate pictures to obtain feature variables of all candidate pictures: F1, F2, F3, ..., Fn.
  • the feature variables of the candidate pictures are clustered according to a preset K-means clustering algorithm to include clustering results of multiple clusters.
  • the centroid is the central point in the cluster, and the characteristic variable value of the centroid is the cluster.
  • the mean of the characteristic variables the characteristic variables.
  • All candidate pictures are classified according to the obtained multiple clusters to obtain a plurality of candidate picture sets containing the candidate pictures. Since each cluster after clustering includes a feature variable value as the centroid of the cluster, by calculating the distance between a candidate picture and all centroids, a centroid closest to the candidate picture can be obtained, and the candidate The pictures are classified into the group corresponding to the centroid. After classifying all candidate pictures according to the above method, a plurality of candidate picture sets including corresponding candidate pictures can be obtained.
  • a picture recommendation model is established according to a preset feature matching formula and the obtained multiple candidate picture sets.
  • a picture recommendation model needs to be established through a preset feature matching formula and the obtained multiple candidate picture sets.
  • the established picture recommendation model is trained through preset multiple sets of training parameters and preset multiple training photos to obtain a trained picture recommendation model.
  • each set of training parameters includes a learning rate, the number of training times, and a training termination condition.
  • the learning rate is the magnitude and direction of adjustment of the parameters in the feature extraction formula of the picture recommendation model, and the number of training times is the picture.
  • the maximum number of times the recommended model is trained.
  • the training termination condition is the condition information to terminate the training of the picture recommendation model. If the training termination condition is reached or the preset number of training times is reached, the training of the picture recommendation model is terminated.
  • the learning rate is 2% of the adjustment range
  • the adjustment direction is magnification adjustment
  • the number of trainings is 15 times
  • the training termination condition is that the difference between the matching probabilities obtained by the two training sessions is less than 3%.
  • step S103 includes sub-steps S1031, S1032, and S1033.
  • Feature extraction is performed on multiple training pictures according to the feature extraction formula to obtain feature variables of all training pictures.
  • Feature extraction is performed on multiple training pictures according to a preset feature extraction formula to obtain the feature variables of all the training pictures.
  • all the training pictures and all candidate pictures in the candidate picture set are used as model training pictures
  • all the training pictures are used as positive samples in the model training picture
  • the pictures in the candidate picture set are used as model training pictures. Negative samples in.
  • a preset set of training parameters is acquired to adjust parameters in the feature extraction formula in the picture recommendation model, and the feature variables of all the training pictures are extracted again according to the adjusted feature extraction formula.
  • the feature matching formula preset in the picture recommendation model is used to calculate the matching probability between a training picture and all the model training pictures.
  • the model training picture with the highest matching probability with the training picture is selected as the training target picture. Determine whether the target picture is the training picture itself.
  • the matching training picture is the training picture itself, the matching result of the training picture is a successful match; if the matching training picture is not the training picture itself, then The matching result of the training picture is a matching failure.
  • the matching results of all the training pictures are counted.
  • the probability of the successful matching of the training picture in the matching result is the accuracy of the training picture in this training.
  • the model training pictures include all training pictures and all candidate pictures in the candidate picture set.
  • the preset training pictures are 100. All the training pictures are matched with all the model training pictures through the picture recommendation model. Among the 100 training pictures, 78 are matched to themselves, and 22 training pictures are not matched to themselves. , The accuracy of the training pictures in this training is 78%.
  • the parameters of the feature extraction formula in the picture recommendation model are adjusted again, and all the training pictures and all models are trained again according to the adjusted picture recommendation model.
  • the pictures are matched and the above training process is repeatedly performed until the training termination condition is reached or the preset number of trainings is reached, the training of the picture recommendation model is terminated, and the accuracy of the training pictures in the last training process is used as the model of the set of training parameters Accuracy.
  • the preset multiple sets of training parameters are sequentially input to train the picture recommendation model, and the model accuracy of all the training parameters is obtained.
  • select the optimal set of training parameters that is, select the set of training parameters with the highest model accuracy, and set the parameters of the feature extraction formula in the picture recommendation model.
  • Get a trained picture recommendation model Specifically, a set of training parameters with the highest model accuracy is selected, and the parameters of the feature extraction formula obtained during the last training process of the set of training parameters when the picture recommendation model is trained are used as the feature extraction in the picture recommendation model after training. The parameters of the formula are set.
  • the picture to be matched is matched with a plurality of candidate picture sets according to the trained picture recommendation model, and the matching probability of the corresponding candidate picture is calculated.
  • the picture to be matched is matched with a plurality of candidate picture sets according to the trained picture recommendation model, and a matching probability of the corresponding candidate picture is calculated through a feature matching formula.
  • step S104 includes sub-steps S1041, S1042, S1043, and S1044.
  • feature extraction is performed on the pictures to be matched to obtain the feature variables of the pictures to be matched.
  • Each candidate picture set corresponds to a specific cluster, and each cluster contains a centroid. Specifically, the distance between the feature variable of the picture to be matched and the feature variable value of the centroid in each candidate picture set is calculated, and according to the calculation result The candidate picture set corresponding to the centroid closest to the picture to be matched among all the centroids is obtained as a target candidate picture set.
  • S1043. Perform feature extraction on the candidate pictures in the target candidate picture set according to the feature extraction formula to obtain the feature variables of the candidate pictures in the target candidate picture set.
  • Feature extraction is performed on the candidate pictures in the target candidate picture set according to the feature extraction formula of the trained picture recommendation model to obtain the feature variables of all candidate pictures in the target candidate picture set.
  • 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 is calculated according to the feature matching formula to obtain the matching probability of all candidate pictures in the candidate picture set.
  • S105 Sort the obtained matching probability of all candidate pictures, and obtain a target picture according to a preset number of target pictures.
  • the matching probabilities of all the obtained candidate pictures are sorted, and target pictures are obtained according to a preset number of target pictures for recommendation to a user.
  • the preset number of target pictures is information about the number of target pictures acquired by the user, sorted according to the matching probability of all candidate pictures in the target candidate picture set, and obtained the target pictures according to the number of target pictures preset by the user. For example, if the number of target pictures preset by the user is 10, according to the ranking result of the matching probability of candidate pictures in the target candidate picture set, the 10 candidate pictures with the highest matching probability among all candidate pictures are selected as target pictures for output.
  • the basic information of the target picture can also be output.
  • the basic information of the target picture includes the time when the target picture was released, the URL of the target picture, the name of the target picture, and the label of the target picture. Information, etc.
  • the candidate picture is classified into multiple candidate picture sets, and a picture recommendation model is established according to the candidate picture set.
  • the picture recommendation model is trained through preset training parameters and training pictures, and the highest matching probability is obtained by matching the trained picture recommendation model.
  • the output of the target picture can accurately match the pictures entered by the user to obtain similar pictures, which greatly reduces the error in the picture matching process and saves the matching time.
  • the embodiment of the present application further provides a picture recommendation device, and the picture recommendation device is configured to execute any one of the foregoing picture recommendation methods.
  • FIG. 6, is a schematic block diagram of a picture recommendation device according to an embodiment of the present application.
  • the picture recommendation device 100 may be configured in a management server.
  • the picture recommendation device 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 classification unit 101 is configured to obtain multiple candidate pictures stored in advance, and classify the candidate pictures according to a preset picture classification rule to obtain multiple candidate picture sets.
  • the picture recommendation device 100 further includes a sub-unit: a candidate picture format adjustment unit 101A.
  • the candidate picture format adjustment unit 101A is configured to adjust the formats of all candidate pictures stored in advance according to a preset format adjustment rule to obtain candidate pictures with a uniform format.
  • the picture classification unit 101 includes sub-units: a candidate picture feature variable extraction unit 1011, a clustering unit 1012, and a candidate picture classification unit 1013.
  • 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.
  • a clustering unit 1012 is configured to cluster feature variables of the candidate pictures according to a preset K-means clustering algorithm to obtain a plurality of clusters including a centroid.
  • the candidate picture classification unit 1013 is configured to classify all candidate pictures according to the obtained multiple groups to obtain a plurality of candidate picture sets including the candidate pictures.
  • the picture recommendation model constructing unit 102 is configured to establish a picture recommendation model according to a preset feature matching formula and the obtained multiple candidate picture sets.
  • the picture recommendation model training unit 103 is configured to train the established picture recommendation model through preset sets of training parameters and preset multiple training pictures to obtain a trained picture recommendation model.
  • the picture recommendation model training unit 103 includes sub-units: a training picture feature variable extraction unit 1031, a model accuracy rate acquisition unit 1032, and a parameter setting unit 1033.
  • the training picture feature variable extraction unit 1031 is configured to perform feature extraction on multiple training pictures according to the feature extraction formula to obtain the feature variables of all the training pictures.
  • a model accuracy rate obtaining unit 1032 is configured to obtain a preset set of training parameters and feature variables of all training pictures, and train the established picture recommendation model multiple times, and use the accuracy rate of the training pictures in the last training as the set of training. Model accuracy of parameters.
  • a parameter setting unit 1033 is configured to select an optimal set of training parameters according to the obtained model accuracy of the 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.
  • the matching probability calculation unit 104 is configured to, if a picture to be matched input by the user is received, match the picture to be matched with a plurality of candidate picture sets according to the trained picture recommendation model, and calculate a matching probability of the corresponding candidate picture.
  • the matching probability calculation unit 104 includes sub-units: feature to-be-matched picture extraction unit 1041, candidate picture set acquisition unit 1042, feature variable extraction unit 1043, and candidate picture matching probability calculation unit. 1044.
  • the feature to-be-matched picture extraction unit 1041 is configured to perform feature extraction on the picture to be matched according to the feature extraction formula to obtain a feature variable of the picture to be matched.
  • the candidate picture set acquiring unit 1042 is configured to perform calculation according to the feature variables of the pictures 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.
  • a 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 the feature variables of the candidate pictures in the target candidate picture set.
  • the candidate picture matching probability calculation unit 1044 is configured to calculate the matching probability of the candidate pictures in the target candidate picture set and the pictures to be matched according to the feature matching formula to obtain the matching probabilities of all candidate pictures.
  • the target picture obtaining unit 105 is configured to sort the matching probability of all the candidate pictures obtained, and obtain a target picture according to a preset number of target pictures.
  • the above picture recommendation device can be implemented in the form of a computer program, which can be run on a computer device as shown in FIG. 11.
  • FIG. 11 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501.
  • the memory may include a non-volatile storage medium 503 and an internal memory 504.
  • the non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032.
  • the processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500.
  • the internal memory 504 provides an environment for running the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute the picture recommendation method.
  • the network interface 505 is used for network communication, such as providing transmission of data information.
  • the structure shown in FIG. 11 is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer equipment 500 to which the scheme of the present application is applied.
  • the specific computer equipment 500 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
  • the processor 502 is configured to run a computer program 5032 stored in a memory to implement the picture recommendation method of this embodiment.
  • the embodiment of the computer device shown in FIG. 11 does not constitute a limitation on the specific configuration of the computer device.
  • the computer device may include more or fewer components than shown in the figure. Either some parts are combined or different parts are arranged.
  • the computer device may include only a memory and a processor. In such an embodiment, the structures and functions of the memory and the processor are consistent with the embodiment shown in FIG. 11, and details are not described herein again.
  • the processor 502 may be a central processing unit (CPU), and the processor 502 may also be another general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), Application-specific integrated circuits (Application Specific Integrated Circuits, ASICs), ready-made programmable gate arrays (Field-Programmable Gate Arrays, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor, or the processor may be any conventional processor.
  • a computer-readable storage medium is provided in another embodiment of the present application.
  • the computer-readable storage medium may be a non-volatile storage medium.
  • the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the picture recommendation method according to the embodiment of the present application is implemented.
  • the storage medium may be an internal storage unit of the foregoing device, such as a hard disk or a memory of the device.
  • the storage medium may also be an external storage device of the device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, and a flash memory card provided on the device. (Flash Card), etc.
  • the storage medium may further include both an internal storage unit of the device and an external storage device.

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

一种图片推荐方法、装置、计算机设备及存储介质。该方法包括:获取预先存储的多张候选图片,根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片集(S101);根据预设的特征匹配公式及所得到的多个候选图片集建立图片推荐模型(S102);通过预设的多组训练参数及预设的多张训练图片对所建立的图片推荐模型进行训练得到训练后的图片推荐模型(S103);若接收到用户所输入的待匹配图片,根据训练后的图片推荐模型对待匹配图片与多个候选图片集进行匹配,并计算得到相应候选图片的匹配概率(S104);对所得到的所有候选图片的匹配概率进行排序,根据预设的目标图片数量获取目标图片(S105)。

Description

图片推荐方法、装置、计算机设备及存储介质
本申请要求于2018年9月21日提交中国专利局、申请号为201811106466.4、申请名称为“图片推荐方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种图片推荐方法、装置、计算机设备及存储介质。
背景技术
在进行计算机编程项目的开发过程中,需将所输入的一张图片与图片库中的多张图片进行匹配,以获取图片库中与所输入的图片相似的目标图片。现有的图片匹配方法中,对图片的整体特征进行匹配会导致匹配误差率较大,而对图片中每一个像素进行匹配则会因巨大的计算量造成匹配耗时长。因而现有的图片匹配方法存在无法高效准确地匹配得到相似图片的问题。
发明内容
本申请实施例提供了一种图片推荐方法、装置、计算机设备及存储介质,旨在解决现有技术中存在无法高效准确地匹配得到相似图片的问题。
第一方面,本申请实施例提供了一种图片推荐方法,其包括:获取预先存储的多张候选图片,根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片集;根据预设的特征匹配公式及所得到的多个候选图片集建立图片推荐模型;通过预设的多组训练参数及预设的多张训练图片对所建立的图片推荐模型进行训练得到训练后的图片推荐模型;若接收到用户所输入的待匹配图片,根据训练后的图片推荐模型对待匹配图片与多个候选图片集进行匹配,并计算得到相应候选图片的匹配概率;对所得到的所有候选图片的匹配概率进行排序,根据预设的目标图片数量获取目标图片。
第二方面,本申请实施例提供了一种图片推荐装置,其包括:图片分类单 元,用于获取预先存储的多张候选图片,根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片集;图片推荐模型构建单元,用于根据预设的特征匹配公式及所得到的多个候选图片集建立图片推荐模型;图片推荐模型训练单元,用于通过预设的多组训练参数及预设的多张训练图片对所建立的图片推荐模型进行训练得到训练后的图片推荐模型;匹配概率计算单元,用于若接收到用户所输入的待匹配图片,根据训练后的图片推荐模型对待匹配图片与多个候选图片集进行匹配,并计算得到相应候选图片的匹配概率;目标图片获取单元,用于对所得到的所有候选图片的匹配概率进行排序,根据预设的目标图片数量获取目标图片。
第三方面,本申请实施例又提供了一种计算机设备,其包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述第一方面所述的图片推荐方法。
第四方面,本申请实施例还提供了一种计算机可读存储介质,其中所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行上述第一方面所述的图片推荐方法。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的图片推荐方法的流程示意图;
图2为本申请实施例提供的图片推荐方法的另一流程示意图;
图3为本申请实施例提供的图片推荐方法的子流程示意图;
图4为本申请实施例提供的图片推荐方法的另一子流程示意图;
图5为本申请实施例提供的图片推荐方法的另一子流程示意图;
图6为本申请实施例提供的图片推荐装置的示意性框图;
图7为本申请实施例提供的图片推荐装置的另一示意性框图;
图8为本申请实施例提供的图片推荐装置的子单元示意性框图;
图9为本申请实施例提供的图片推荐装置的另一子单元示意性框图;
图10为本申请实施例提供的图片推荐装置的另一子单元示意性框图;
图11为本申请实施例提供的计算机设备的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
请参阅图1,图1是本申请实施例提供的图片推荐方法的流程示意图。该图片推荐方法应用于服务器端,该方法通过安装于服务器端中的应用软件进行执行,其中,服务器端即是用于执行图片推荐方法以推荐相似图片的企业终端。
如图1所示,该方法包括步骤S101~S105。
S101、获取预先存储的多张候选图片,根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片集。
服务器端预先存储有多张候选图片,根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片集。服务器端即是用于对图片推荐模型进行构建和使用的企业终端。根据预设的图片分类规则对所有候选图片进行分类处理,以得到多个候选图片集。图片分类规则即是用于对候选图片进行分类的规则信息,其中,图片分类规则包括特征提取公式、K-means聚类算法。
在一实施例中,如图2所示,步骤S101之前还包括步骤S101A。
S101A、根据预设的格式调整规则对预先存储的所有候选图片的格式进行调整以得到格式统一的候选图片。
由于预先存储的候选图片无法确保格式完全统一,在对候选图片进行分类之前,可根据预设的格式调整规则对预先存储的所有候选图片的格式进行统一调整。例如,可对所有候选图片的尺寸进行调整,以将所有候选图片的分辨率调整为200×200,即可得到格式统一的候选图片。
在一实施例中,如图3所示,步骤S101包括子步骤S1011、S1012和S1013。
S1011、根据预设的特征提取公式对所述候选图片进行特征提取以得到所有候选图片的特征变量。
根据预设的特征提取公式对所有候选图片的特征变量进行提取。其中,预设的特征提取公式基于卷积神经网络进行构建。预设的特征提取公式包括第一卷积计算公式、池化计算公式、第二卷积计算公式、第一全连接计算公式、第二全连接计算公式。通过特征提取公式即可提取得到所有候选图片的特征变量。候选图片的特征变量即是通过对图片进行特征提取之后所得到的用于反映图片特性的多维向量,计算机程序无法对不同的图片进行识别,但将多个图片转换为特征变量后,计算机程序通过对多个图片的特征变量进行分析即可对不同的图片进行识别。
具体的,若输入的候选图片的分辨率为200×200,根据第一卷积计算公式,以分辨率10*10作为窗口,步长为1,进行卷积操作,以得到大小为190×190的向量矩阵,也即是候选图片的浅层特征;根据池化计算公式,以分辨率10×10作为窗口,步长为10,进行降采样,以得到大小为18×18的向量矩阵,也即是候选图片的深层次特征;根据第二卷积计算公式,以分辨率2×2作为窗口,步长为2的进行卷积操作,以得到大小为9×9的向量矩阵。通过第一全连接计算公式,对所得到的9×9的向量矩阵进行计算,第一全连接公式中共包含五个节点,每一个节点均与9×9的向量矩阵相关联,也即是分别通过五个计算公式计算得到与9×9的向量矩阵相关联的五个节点的值,第一个计算公式可表示为C1=W1×x1+B1,其中,C1为第一个节点的计算值,x1为该候选图片向量矩阵的值,W1和B1为第一节点与该向量矩阵向关联的第一计算公式中所预设的参数值,通过五个计算公式即可计算与该向量矩阵向关联的五个节点的值;通过第二全连接计算公式对五个节点的值进行计算以得到最终该候选图片的特征变 量,计算公式为F1=a1×C1+a2×C2+a3×C3+a4×C4+a5×C5;其中C1、C2、C3、C4、C5为与该候选图片的向量矩阵相关联的五个节点的值,a1、a2、a3、a4、a5为五个节点至最后输出节点的预设参数值,最后得到该候选图片的特征变量为一个1×128维的向量矩阵,可以采用F1=(f1,f2……f128)来表示。
根据上述特征提取公式可对所有候选图片进行特征提取以得到所有候选图片的特征变量:F1、F2、F3……Fn。
S1012、根据预设的K-means聚类算法对所述候选图片的特征变量进行聚类以得到包含质心的多个类群。
根据预设的K-means聚类算法对所述候选图片的特征变量进行聚类以包含多个类群的聚类结果。具体的,在K-means聚类算法中设置最终所需类群的数量K,根据K的数值对所有候选图片的特征变量进行聚类,得到K个类群中每一类群质心的特征变量值。例如,在K-means聚类算法中设置K=5,则最终得到5个类群以及每一类群质心的特征变量值,质心即是该类群中的中心点,质心的特征变量值即是该类群特征变量的均值。
S1013、根据所得到的多个类群对所有候选图片进行分类以得到包含候选图片的多个候选图片集。
根据所得到的多个类群对所有候选图片进行分类,以得到包含候选图片的多个候选图片集。由于聚类之后的每一个类群都包含一个特征变量值作为该类群的质心,通过计算一个候选图片与所有质心之间的距离,即可得到与该候选图片距离最近的一个质心,并将该候选图片分类至该质心所对应的类群中。根据上述方法将所有候选图片进行分类之后,即可得到包含相应候选图片的多个候选图片集。
S102、根据预设的特征匹配公式及所得到的多个候选图片集建立图片推荐模型。
根据预设的特征匹配公式及所得到的多个候选图片集建立图片推荐模型。为实现对用户所输入的图片进行识别,并对用户所输入图片与候选图片的匹配概率进行计算,需通过预设的特征匹配公式及所得到的多个候选图片集建立图片推荐模型。具体的,所述预设的特征匹配公式为S=1/(((f1-t1) 2+(f2-t2) 2+……+(fn-tn) 2) -1+1),其中,f1、f2……fn为某一张候选图片的特征变量值,t1、t2……tn为用户所输入图片的特征变量值,由于候选图片的特征变量为一个1×128维 的向量矩阵,则上式中n=128。
S103、通过预设的多组训练参数及预设的多张训练图片对所建立的图片推荐模型进行训练得到训练后的图片推荐模型。
通过预设的多组训练参数,以及预设的多张训练照片对所建立的图片推荐模型进行训练,以得到训练后的图片推荐模型。具体的,每一组训练参数中均包括学习率、训练次数以及训练终止条件,学习率即是对图片推荐模型的特征提取公式中参数进行调整的幅度及调整的方向,训练次数即是对图片推荐模型进行最大训练的次数,训练终止条件即是对图片推荐模型的训练进行终止的条件信息,若达到训练终止条件或达到预设的训练次数,则终止对图片推荐模型的训练。
例如,预设的一组训练参数中,学习率为调整幅度2%、调整方向为放大调整,训练次数为15次,训练终止条件为前后两次训练所得到的匹配概率之差小于3%。
在一实施例中,如图4所示,步骤S103包括子步骤S1031、S1032和S1033。
S1031、根据所述特征提取公式对多张训练图片进行特征提取以得到所有训练图片的特征变量。
根据预设的特征提取公式对多种训练图片进行特征提取以得到所有训练图片的特征变量。在对图片推荐模型进行训练的过程中,将所有训练图片及候选图片集中所有候选图片作为模型训练图片,所有训练图片均作为模型训练图片中的正样本,候选图片集中的图片均作为模型训练图片中的负样本。
S1032、获取预设的一组训练参数及所有训练图片的特征变量对所建立的图片推荐模型进行多次训练,将最后一次训练中训练图片的准确率作为该组训练参数的模型准确率。
获取预设的一组训练参数及所有训练图片的特征变量对所建立的图片推荐模型进行多次训练,将最后一次训练中训练图片的准确率作为该组训练参数的模型准确率。具体的,获取预设的一组训练参数对图片推荐模型中特征提取公式中参数进行调整,根据调整后的特征提取公式对所有训练图片的特征变量进行再次提取。通过图片推荐模型中预设的特征匹配公式对某一张训练图片与所有模型训练图片的匹配概率进行计算,选择与该训练图片匹配概率最高的模型训练图片作为训练目标图片,对匹配得到的训练目标图片是否为该训练图片本 身进行判断,若匹配得到的训练目标图片为该训练图片本身,则该训练图片的匹配结果为匹配成功;若匹配得到的训练目标图片不为该训练图片本身,则该训练图片的匹配结果为匹配失败,统计所有训练图片的匹配结果,匹配结果中训练图片匹配成功的概率即为本次训练中训练图片的准确率。其中,模型训练图片包括所有训练图片及候选图片集中所有的候选图片。
例如,预设的训练图片为100张,通过图片推荐模型将所有训练图片与所有模型训练图片进行匹配,100张训练图片中匹配到其自身的为78张,22张训练图片未匹配到其自身,则本次训练中训练图片的准确率为78%。
根据第一次训练所得到的训练图片的准确率及该组训练参数对图片推荐模型中特征提取公式的参数进行再次调整,并根据调整后的图片推荐模型再次对所有训练图片与与所有模型训练图片进行匹配,反复执行上述训练过程,直到达到训练终止条件或达到预设的训练次数,则终止对图片推荐模型的训练,得到最后一次训练过程中训练图片的准确率作为该组训练参数的模型准确率。
通过上述方法将所预设的多组训练参数依次输入对图片推荐模型进行训练,得到所有训练参数的模型准确率。
S1033、根据所得到的多组训练参数的模型准确率选择最优的一组训练参数对图片推荐模型中特征提取公式的参数进行设置以得到训练后的图片推荐模型。
根据所得到的多组训练参数的模型准确率选择最优的一组训练参数,也即是选择模型准确率最高的一组训练参数,对图片推荐模型中特征提取公式的参数进行设置,即可得到训练后的图片推荐模型。具体的,选择模型准确率最高的一组训练参数,将该组训练参数在对图片推荐模型进行训练时最后一次训练过程中所得到的特征提取公式的参数,作为训练后图片推荐模型中特征提取公式的参数进行设置。
S104、若接收到用户所输入的待匹配图片,根据训练后的图片推荐模型对待匹配图片与多个候选图片集进行匹配,并计算得到相应候选图片的匹配概率。
若收到用户所输入的待匹配图片,根据训练后的图片推荐模型对待匹配图片与多个候选图片集中进行匹配,并通过特征匹配公式计算得到相应候选图片的匹配概率。
在一实施例中,如图5所示,步骤S104包括子步骤S1041、S1042、S1043和S1044。
S1041、根据所述特征提取公式对待匹配图片进行特征提取以得到待匹配图片的特征变量。
具体的,根据训练后图片推荐模型的特征提取公式对待匹配图片进行特征提取,以得到待匹配图片的特征变量。
S1042、根据待匹配图片的特征变量与多个候选图片集中质心的特征变量值进行计算以得到目标候选图片集。
根据待匹配图片的特征变量与多个候选图片集中质心的特征变量值进行计算以得到目标候选图片集。每一个候选图片集对应一个具体的类群,每一个类群均包含一个质心,具体的,将待匹配图片的特征变量与每一候选图片集中质心的特征变量值之间的距离进行计算,根据计算结果获取所有质心中最接近该待匹配图片的质心所对应的候选图片集作为目标候选图片集。
S1043、根据特征提取公式对目标候选图片集中的候选图片进行特征提取以得到该目标候选图片集中候选图片的特征变量。
根据训练后图片推荐模型的特征提取公式对目标候选图片集中的候选图片进行特征提取以得到该目标候选图片集中所有候选图片的特征变量。
S1044、根据所述特征匹配公式对目标候选图片集中候选图片与待匹配图片的匹配概率进行计算以得到所有候选图片的匹配概率。
根据所述特征匹配公式对目标候选图片集中所有候选图片的特征变量与待匹配图片的特征变量的匹配概率进行计算,以得到该候选图片集中所有候选图片的匹配概率。
S105、对所得到的所有候选图片的匹配概率进行排序,根据预设的目标图片数量获取目标图片。
对所得到的所有候选图片的匹配概率进行排序,根据预设的目标图片数量获取得到目标图片以向用户进行推荐。预设的目标图片数量为用户所预设的对目标图片进行获取的数量信息,根据目标候选图片集中所有候选图片的匹配概率进行排序,并根据用户所预设的目标图片数量获取目标图片。例如,用户所预设的目标图片数量为10张,则根据目标候选图片集中候选图片匹配概率的排序结果,选择所有候选图片中匹配概率最高的10张候选图片作为目标图片进行输出。具体的,在对目标图片进行输出的过程中还可输出目标图片的基本信息,目标图片的基本信息中包含了目标图片发布的时间、获取目标图片的网址、目 标图片的名称以及目标图片的标签信息等。
通过将候选图片分类至多个候选图片集,并根据候选图片集建立图片推荐模型,通过预设的训练参数及训练图片对图片推荐模型进行训练,并根据训练后的图片推荐模型匹配得到匹配概率最高的目标图片进行输出,能够高效地对用户所输入的图片进行精确匹配以得到相似图片,大幅降低了图片匹配过程中的误差,节省了匹配时间。
本申请实施例还提供一种图片推荐装置,该图片推荐装置用于执行前述图片推荐方法的任一实施例。具体地,请参阅图6,图6是本申请实施例提供的图片推荐装置的示意性框图。该图片推荐装置100可以配置于管理服务器中。
如图6所示,图片推荐装置100包括图片分类单元101、图片推荐模型构建单元102、图片推荐模型训练单元103、匹配概率计算单元104和目标图片获取单元105。
图片分类单元101,用于获取预先存储的多张候选图片,根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片集。
其他申请实施例中,如图7所示,所述,图片推荐装置100还包括子单元:候选图片格式调整单元101A。
候选图片格式调整单元101A,用于根据预设的格式调整规则对预先存储的所有候选图片的格式进行调整以得到格式统一的候选图片。
其他申请实施例中,如图8所示,所述图片分类单元101包括子单元:候选图片特征变量提取单元1011、聚类单元1012和候选图片分类单元1013。
候选图片特征变量提取单元1011,用于根据预设的特征提取公式对所述候选图片进行特征提取以得到所有候选图片的特征变量。
聚类单元1012,用于根据预设的K-means聚类算法对所述候选图片的特征变量进行聚类以得到包含质心的多个类群。
候选图片分类单元1013,用于根据所得到的多个类群对所有候选图片进行分类以得到包含候选图片的多个候选图片集。
图片推荐模型构建单元102,用于根据预设的特征匹配公式及所得到的多个候选图片集建立图片推荐模型。
图片推荐模型训练单元103,用于通过预设的多组训练参数及预设的多张训练图片对所建立的图片推荐模型进行训练得到训练后的图片推荐模型。
其他申请实施例中,如图9所示,所述图片推荐模型训练单元103包括子单元:训练图片特征变量提取单元1031、模型准确率获取单元1032和参数设置单元1033。
训练图片特征变量提取单元1031,用于根据所述特征提取公式对多张训练图片进行特征提取以得到所有训练图片的特征变量。
模型准确率获取单元1032,用于获取预设的一组训练参数及所有训练图片的特征变量对所建立的图片推荐模型进行多次训练,将最后一次训练中训练图片的准确率作为该组训练参数的模型准确率。
参数设置单元1033,用于根据所得到的多组训练参数的模型准确率选择最优的一组训练参数对图片推荐模型中特征提取公式的参数进行设置以得到训练后的图片推荐模型。
匹配概率计算单元104,用于若接收到用户所输入的待匹配图片,根据训练后的图片推荐模型对待匹配图片与多个候选图片集进行匹配,并计算得到相应候选图片的匹配概率。
其他申请实施例中,如图10所示,所述匹配概率计算单元104包括子单元:待匹配图片特征提取单元1041、候选图片集获取单元1042、特征变量提取单元1043和候选图片匹配概率计算单元1044。
待匹配图片特征提取单元1041,用于根据所述特征提取公式对待匹配图片进行特征提取以得到待匹配图片的特征变量。
候选图片集获取单元1042,用于根据待匹配图片的特征变量与多个候选图片集中质心的特征变量值进行计算以得到目标候选图片集。
特征变量提取单元1043,用于根据特征提取公式对目标候选图片集中的候选图片进行特征提取以得到该目标候选图片集中候选图片的特征变量。
候选图片匹配概率计算单元1044,用于根据所述特征匹配公式对目标候选图片集中候选图片与待匹配图片的匹配概率进行计算以得到所有候选图片的匹配概率。
目标图片获取单元105,用于对所得到的所有候选图片的匹配概率进行排序,根据预设的目标图片数量获取目标图片。
上述图片推荐装置可以实现为计算机程序的形式,该计算机程序可以在如图11所示的计算机设备上运行。
请参阅图11,图11是本申请实施例提供的计算机设备的示意性框图。
参阅图11,该计算机设备500包括通过系统总线501连接的处理器502、存储器和网络接口505,其中,存储器可以包括非易失性存储介质503和内存储器504。该非易失性存储介质503可存储操作系统5031和计算机程序5032。该计算机程序5032被执行时,可使得处理器502执行图片推荐方法。该处理器502用于提供计算和控制能力,支撑整个计算机设备500的运行。该内存储器504为非易失性存储介质503中的计算机程序5032的运行提供环境,该计算机程序5032被处理器502执行时,可使得处理器502执行图片推荐方法。该网络接口505用于进行网络通信,如提供数据信息的传输等。本领域技术人员可以理解,图11中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备500的限定,具体的计算机设备500可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
其中,所述处理器502用于运行存储在存储器中的计算机程序5032,以实现本实施例的图片推荐方法。
本领域技术人员可以理解,图11中示出的计算机设备的实施例并不构成对计算机设备具体构成的限定,在其他实施例中,计算机设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。例如,在一些实施例中,计算机设备可以仅包括存储器及处理器,在这样的实施例中,存储器及处理器的结构及功能与图11所示实施例一致,在此不再赘述。
应当理解,在本申请实施例中,处理器502可以是中央处理单元(Central Processing Unit,CPU),该处理器502还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
在本申请的另一实施例中提供计算机可读存储介质。该计算机可读存储介质可以为非易失性的存储介质。该计算机可读存储介质存储有计算机程序,其中计算机程序被处理器执行时实现本申请实施例的图片推荐方法。
所述存储介质可以是前述设备的内部存储单元,例如设备的硬盘或内存。 所述存储介质也可以是所述设备的外部存储设备,例如所述设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储介质还可以既包括所述设备的内部存储单元也包括外部存储设备。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的设备、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种图片推荐方法,包括:
    获取预先存储的多张候选图片,根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片集;
    根据预设的特征匹配公式及所得到的多个候选图片集建立图片推荐模型;
    通过预设的多组训练参数及预设的多张训练图片对所建立的图片推荐模型进行训练得到训练后的图片推荐模型;
    若接收到用户所输入的待匹配图片,根据训练后的图片推荐模型对待匹配图片与多个候选图片集进行匹配,并计算得到相应候选图片的匹配概率;
    对所得到的所有候选图片的匹配概率进行排序,根据预设的目标图片数量获取目标图片。
  2. 根据权利要求1所述的方法,其中,所述根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片集,包括:
    根据预设的特征提取公式对所述候选图片进行特征提取以得到所有候选图片的特征变量;
    根据预设的K-means聚类算法对所述候选图片的特征变量进行聚类以得到包含质心的多个类群;
    根据所得到的多个类群对所有候选图片进行分类以得到包含候选图片的多个候选图片集。
  3. 根据权利要求2所述的方法,其中,所述通过预设的多组训练参数及预设的多张训练图片对所建立的图片推荐模型进行训练得到训练后的图片推荐模型,包括:
    根据所述特征提取公式对多张训练图片进行特征提取以得到所有训练图片的特征变量;
    获取预设的一组训练参数及所有训练图片的特征变量对所建立的图片推荐模型进行多次训练,将最后一次训练中训练图片的准确率作为该组训练参数的模型准确率;
    根据所得到的多组训练参数的模型准确率选择最优的一组训练参数对图片推荐模型中特征提取公式的参数进行设置以得到训练后的图片推荐模型。
  4. 根据权利要求2所述的方法,其中,所述根据训练后的图片推荐模型对待匹配图片与多个候选图片集进行匹配以得到相应候选图片的匹配概率,包括:
    根据所述特征提取公式对待匹配图片进行特征提取以得到待匹配图片的特征变量;
    根据待匹配图片的特征变量与多个候选图片集中质心的特征变量值进行计算以得到目标候选图片集;
    根据特征提取公式对目标候选图片集中的候选图片进行特征提取以得到该目标候选图片集中候选图片的特征变量;
    根据所述特征匹配公式对目标候选图片集中候选图片与待匹配图片的匹配概率进行计算以得到所有候选图片的匹配概率。
  5. 根据权利要求1所述的方法,其中,所述获取预先存储的多张候选图片,根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片集之前,还包括:
    根据预设的格式调整规则对预先存储的所有候选图片的格式进行调整以得到格式统一的候选图片。
  6. 一种图片推荐装置,包括:
    图片分类单元,用于获取预先存储的多张候选图片,根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片集;
    图片推荐模型构建单元,用于根据预设的特征匹配公式及所得到的多个候选图片集建立图片推荐模型;
    图片推荐模型训练单元,用于通过预设的多组训练参数及预设的多张训练图片对所建立的图片推荐模型进行训练得到训练后的图片推荐模型;
    匹配概率计算单元,用于若接收到用户所输入的待匹配图片,根据训练后的图片推荐模型对待匹配图片与多个候选图片集进行匹配,并计算得到相应候选图片的匹配概率;
    目标图片获取单元,用于对所得到的所有候选图片的匹配概率进行排序,根据预设的目标图片数量获取目标图片。
  7. 根据权利要求6所述的装置,其中,所述图片分类单元,包括:
    候选图片特征变量提取单元,用于根据预设的特征提取公式对所述候选图片进行特征提取以得到所有候选图片的特征变量;
    聚类单元,用于根据预设的K-means聚类算法对所述候选图片的特征变量进行聚类以得到包含质心的多个类群;
    候选图片分类单元,用于根据所得到的多个类群对所有候选图片进行分类以得到包含候选图片的多个候选图片集。
  8. 根据权利要求6所述的装置,其中,所述图片推荐模型训练单元,包括:
    训练图片特征变量提取单元,用于根据所述特征提取公式对多张训练图片进行特征提取以得到所有训练图片的特征变量;
    模型准确率获取单元,用于获取预设的一组训练参数及所有训练图片的特征变量对所建立的图片推荐模型进行多次训练,将最后一次训练中训练图片的准确率作为该组训练参数的模型准确率;
    参数设置单元,用于根据所得到的多组训练参数的模型准确率选择最优的一组训练参数对图片推荐模型中特征提取公式的参数进行设置以得到训练后的图片推荐模型。
  9. 根据权利要求6所述的装置,其中,所述图片推荐模型训练单元,包括:
    训练图片特征变量提取单元,用于根据所述特征提取公式对多张训练图片进行特征提取以得到所有训练图片的特征变量;
    模型准确率获取单元,用于获取预设的一组训练参数及所有训练图片的特征变量对所建立的图片推荐模型进行多次训练,将最后一次训练中训练图片的准确率作为该组训练参数的模型准确率;
    参数设置单元,用于根据所得到的多组训练参数的模型准确率选择最优的一组训练参数对图片推荐模型中特征提取公式的参数进行设置以得到训练后的图片推荐模型。
  10. 根据权利要求6所述的装置,其中,所述匹配概率计算单元,包括:
    待匹配图片特征提取单元,用于根据所述特征提取公式对待匹配图片进行特征提取以得到待匹配图片的特征变量;
    候选图片集获取单元,用于根据待匹配图片的特征变量与多个候选图片集中质心的特征变量值进行计算以得到目标候选图片集;
    特征变量提取单元,用于根据特征提取公式对目标候选图片集中的候选图片进行特征提取以得到该目标候选图片集中候选图片的特征变量;
    候选图片匹配概率计算单元,用于根据所述特征匹配公式对目标候选图片 集中候选图片与待匹配图片的匹配概率进行计算以得到所有候选图片的匹配概率。
  11. 一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现以下步骤:
    获取预先存储的多张候选图片,根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片集;
    根据预设的特征匹配公式及所得到的多个候选图片集建立图片推荐模型;
    通过预设的多组训练参数及预设的多张训练图片对所建立的图片推荐模型进行训练得到训练后的图片推荐模型;
    若接收到用户所输入的待匹配图片,根据训练后的图片推荐模型对待匹配图片与多个候选图片集进行匹配,并计算得到相应候选图片的匹配概率;
    对所得到的所有候选图片的匹配概率进行排序,根据预设的目标图片数量获取目标图片。
  12. 根据权利要求11所述的计算机设备,其中,所述根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片集,包括:
    根据预设的特征提取公式对所述候选图片进行特征提取以得到所有候选图片的特征变量;
    根据预设的K-means聚类算法对所述候选图片的特征变量进行聚类以得到包含质心的多个类群;
    根据所得到的多个类群对所有候选图片进行分类以得到包含候选图片的多个候选图片集。
  13. 根据权利要求12所述的计算机设备,其中,所述通过预设的多组训练参数及预设的多张训练图片对所建立的图片推荐模型进行训练得到训练后的图片推荐模型,包括:
    根据所述特征提取公式对多张训练图片进行特征提取以得到所有训练图片的特征变量;
    获取预设的一组训练参数及所有训练图片的特征变量对所建立的图片推荐模型进行多次训练,将最后一次训练中训练图片的准确率作为该组训练参数的模型准确率;
    根据所得到的多组训练参数的模型准确率选择最优的一组训练参数对图片推荐模型中特征提取公式的参数进行设置以得到训练后的图片推荐模型。
  14. 根据权利要求12所述的计算机设备,其中,所述根据训练后的图片推荐模型对待匹配图片与多个候选图片集进行匹配以得到相应候选图片的匹配概率,包括:
    根据所述特征提取公式对待匹配图片进行特征提取以得到待匹配图片的特征变量;
    根据待匹配图片的特征变量与多个候选图片集中质心的特征变量值进行计算以得到目标候选图片集;
    根据特征提取公式对目标候选图片集中的候选图片进行特征提取以得到该目标候选图片集中候选图片的特征变量;
    根据所述特征匹配公式对目标候选图片集中候选图片与待匹配图片的匹配概率进行计算以得到所有候选图片的匹配概率。
  15. 根据权利要求11所述的计算机设备,其中,所述获取预先存储的多张候选图片,根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片集之前,还包括:
    根据预设的格式调整规则对预先存储的所有候选图片的格式进行调整以得到格式统一的候选图片。
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行以下操作:
    获取预先存储的多张候选图片,根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片集;
    根据预设的特征匹配公式及所得到的多个候选图片集建立图片推荐模型;
    通过预设的多组训练参数及预设的多张训练图片对所建立的图片推荐模型进行训练得到训练后的图片推荐模型;
    若接收到用户所输入的待匹配图片,根据训练后的图片推荐模型对待匹配图片与多个候选图片集进行匹配,并计算得到相应候选图片的匹配概率;
    对所得到的所有候选图片的匹配概率进行排序,根据预设的目标图片数量获取目标图片。
  17. 根据权利要求16所述的存储介质,其中,所述根据预设的图片分类规则 对所述候选图片进行分类以得到多个候选图片集,包括:
    根据预设的特征提取公式对所述候选图片进行特征提取以得到所有候选图片的特征变量;
    根据预设的K-means聚类算法对所述候选图片的特征变量进行聚类以得到包含质心的多个类群;
    根据所得到的多个类群对所有候选图片进行分类以得到包含候选图片的多个候选图片集。
  18. 根据权利要求17所述的存储介质,其中,所述通过预设的多组训练参数及预设的多张训练图片对所建立的图片推荐模型进行训练得到训练后的图片推荐模型,包括:
    根据所述特征提取公式对多张训练图片进行特征提取以得到所有训练图片的特征变量;
    获取预设的一组训练参数及所有训练图片的特征变量对所建立的图片推荐模型进行多次训练,将最后一次训练中训练图片的准确率作为该组训练参数的模型准确率;
    根据所得到的多组训练参数的模型准确率选择最优的一组训练参数对图片推荐模型中特征提取公式的参数进行设置以得到训练后的图片推荐模型。
  19. 根据权利要求17所述的存储介质,其中,所述根据训练后的图片推荐模型对待匹配图片与多个候选图片集进行匹配以得到相应候选图片的匹配概率,包括:
    根据所述特征提取公式对待匹配图片进行特征提取以得到待匹配图片的特征变量;
    根据待匹配图片的特征变量与多个候选图片集中质心的特征变量值进行计算以得到目标候选图片集;
    根据特征提取公式对目标候选图片集中的候选图片进行特征提取以得到该目标候选图片集中候选图片的特征变量;
    根据所述特征匹配公式对目标候选图片集中候选图片与待匹配图片的匹配概率进行计算以得到所有候选图片的匹配概率。
  20. 根据权利要求16所述的存储介质,其中,所述获取预先存储的多张候选图片,根据预设的图片分类规则对所述候选图片进行分类以得到多个候选图片 集之前,还包括:
    根据预设的格式调整规则对预先存储的所有候选图片的格式进行调整以得到格式统一的候选图片。
PCT/CN2018/124798 2018-09-21 2018-12-28 图片推荐方法、装置、计算机设备及存储介质 WO2020056999A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811106466.4 2018-09-21
CN201811106466.4A CN109241318B (zh) 2018-09-21 2018-09-21 图片推荐方法、装置、计算机设备及存储介质

Publications (1)

Publication Number Publication Date
WO2020056999A1 true WO2020056999A1 (zh) 2020-03-26

Family

ID=65056387

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/124798 WO2020056999A1 (zh) 2018-09-21 2018-12-28 图片推荐方法、装置、计算机设备及存储介质

Country Status (2)

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

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112558958A (zh) * 2020-12-16 2021-03-26 中国平安人寿保险股份有限公司 基于模板的推送内容生成方法、装置及计算机设备
CN112766288A (zh) * 2021-03-03 2021-05-07 重庆赛迪奇智人工智能科技有限公司 图像处理模型构建方法、装置、电子设备和可读存储介质
CN113769387A (zh) * 2021-09-18 2021-12-10 网易(杭州)网络有限公司 游戏图形参数配置的方法、装置及终端设备

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110232401B (zh) * 2019-05-05 2023-08-04 平安科技(深圳)有限公司 基于图片转换的病灶判断方法、装置、计算机设备
CN110533050B (zh) * 2019-07-22 2023-11-24 平安科技(深圳)有限公司 图片地理信息获取方法、装置、计算机设备及存储介质
CN111461228B (zh) * 2020-04-01 2024-03-15 腾讯科技(深圳)有限公司 图像推荐方法和装置及存储介质
CN112069337A (zh) * 2020-09-03 2020-12-11 Oppo广东移动通信有限公司 图片处理方法、装置、电子设备及存储介质
CN113792202B (zh) * 2021-08-31 2023-05-05 中国电子科技集团公司第三十研究所 一种用户分类的筛选方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101551809A (zh) * 2009-05-13 2009-10-07 西安电子科技大学 基于高斯混合模型分类的sar图像检索方法
CN103914527A (zh) * 2014-03-28 2014-07-09 西安电子科技大学 一种基于新编码方式的遗传规划算法的图形图像识别与匹配方法
US20160148072A1 (en) * 2012-03-13 2016-05-26 Massachusetts Institute Of Technology Assisted surveillance of vehicles-of-interest
CN106202362A (zh) * 2016-07-07 2016-12-07 Tcl集团股份有限公司 图像推荐方法和图像推荐装置
CN106383912A (zh) * 2016-10-14 2017-02-08 上海谦问万答吧云计算科技有限公司 一种图片检索方法和装置
CN108509466A (zh) * 2017-04-14 2018-09-07 腾讯科技(深圳)有限公司 一种信息推荐方法和装置

Family Cites Families (4)

* 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
CN105045818B (zh) * 2015-06-26 2017-07-18 腾讯科技(深圳)有限公司 一种图片的推荐方法、装置和系统
CN106021362B (zh) * 2016-05-10 2018-04-13 百度在线网络技术(北京)有限公司 查询式的图片特征表示的生成、图片搜索方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101551809A (zh) * 2009-05-13 2009-10-07 西安电子科技大学 基于高斯混合模型分类的sar图像检索方法
US20160148072A1 (en) * 2012-03-13 2016-05-26 Massachusetts Institute Of Technology Assisted surveillance of vehicles-of-interest
CN103914527A (zh) * 2014-03-28 2014-07-09 西安电子科技大学 一种基于新编码方式的遗传规划算法的图形图像识别与匹配方法
CN106202362A (zh) * 2016-07-07 2016-12-07 Tcl集团股份有限公司 图像推荐方法和图像推荐装置
CN106383912A (zh) * 2016-10-14 2017-02-08 上海谦问万答吧云计算科技有限公司 一种图片检索方法和装置
CN108509466A (zh) * 2017-04-14 2018-09-07 腾讯科技(深圳)有限公司 一种信息推荐方法和装置

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LI, YU ET AL.: "Optical remote sensing image retrieval based on convolutional neural networks", OPTICS AND PRECISION ENGINEERING, vol. 26, no. 1, 31 January 2018 (2018-01-31), pages 201-203 - 205 *
ZHANG, HONGQUN ET AL.: "Retrieval of remote sensing images based on semisupervised deep learning", JOURNAL OF REMOTE SENSING, no. 3, 25 May 2017 (2017-05-25), pages 406, 407 - 409, ISSN: 1007-4619 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112558958A (zh) * 2020-12-16 2021-03-26 中国平安人寿保险股份有限公司 基于模板的推送内容生成方法、装置及计算机设备
CN112558958B (zh) * 2020-12-16 2023-07-25 中国平安人寿保险股份有限公司 基于模板的推送内容生成方法、装置及计算机设备
CN112766288A (zh) * 2021-03-03 2021-05-07 重庆赛迪奇智人工智能科技有限公司 图像处理模型构建方法、装置、电子设备和可读存储介质
CN112766288B (zh) * 2021-03-03 2024-01-23 重庆赛迪奇智人工智能科技有限公司 图像处理模型构建方法、装置、电子设备和可读存储介质
CN113769387A (zh) * 2021-09-18 2021-12-10 网易(杭州)网络有限公司 游戏图形参数配置的方法、装置及终端设备

Also Published As

Publication number Publication date
CN109241318A (zh) 2019-01-18
CN109241318B (zh) 2023-06-13

Similar Documents

Publication Publication Date Title
WO2020056999A1 (zh) 图片推荐方法、装置、计算机设备及存储介质
WO2020239015A1 (zh) 一种图像识别、分类方法、装置、电子设备及存储介质
US20210256320A1 (en) Machine learning artificialintelligence system for identifying vehicles
JP6994588B2 (ja) 顔特徴抽出モデル訓練方法、顔特徴抽出方法、装置、機器および記憶媒体
WO2022048173A1 (zh) 基于人工智能的客户意图识别方法、装置、设备及介质
US8117609B2 (en) System and method for optimizing changes of data sets
CN108287857B (zh) 表情图片推荐方法及装置
CN109858505B (zh) 分类识别方法、装置及设备
US20210049416A1 (en) Artificial intelligence system for inspecting image reliability
CN110750658B (zh) 一种媒体资源的推荐方法、服务器及计算机可读存储介质
WO2023185539A1 (zh) 机器学习模型训练方法、业务数据处理方法、装置及系统
WO2021098618A1 (zh) 数据分类方法、装置、终端设备及可读存储介质
CN111797320B (zh) 数据处理方法、装置、设备及存储介质
CN112862093A (zh) 一种图神经网络训练方法及装置
CN107590460A (zh) 人脸分类方法、装置及智能终端
WO2019001463A1 (zh) 数据处理方法及装置
CN112861894A (zh) 一种数据流分类方法、装置及系统
US20240135698A1 (en) Image classification method, model training method, device, storage medium, and computer program
CN111159481B (zh) 图数据的边预测方法、装置及终端设备
CN112541447A (zh) 机器模型的更新方法、装置、介质及设备
WO2022194049A1 (zh) 一种对象处理方法及装置
US20210319058A1 (en) Location-based alarm notification application
CN109933969B (zh) 验证码识别方法、装置、电子设备及可读存储介质
CN115730205A (zh) 一种配置决策装置的方法、装置及相关设备
CN112861962A (zh) 样本处理方法、装置、电子设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18934211

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18934211

Country of ref document: EP

Kind code of ref document: A1