CN111461195A - Picture checking method and device and electronic equipment - Google Patents

Picture checking method and device and electronic equipment Download PDF

Info

Publication number
CN111461195A
CN111461195A CN202010229707.5A CN202010229707A CN111461195A CN 111461195 A CN111461195 A CN 111461195A CN 202010229707 A CN202010229707 A CN 202010229707A CN 111461195 A CN111461195 A CN 111461195A
Authority
CN
China
Prior art keywords
picture
category
tested
name
probability value
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.)
Granted
Application number
CN202010229707.5A
Other languages
Chinese (zh)
Other versions
CN111461195B (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.)
Yingda Business Services Ltd
State Grid E Commerce Co Ltd
Original Assignee
Yingda Business Services Ltd
State Grid E Commerce 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 Yingda Business Services Ltd, State Grid E Commerce Co Ltd filed Critical Yingda Business Services Ltd
Priority to CN202010229707.5A priority Critical patent/CN111461195B/en
Publication of CN111461195A publication Critical patent/CN111461195A/en
Application granted granted Critical
Publication of CN111461195B publication Critical patent/CN111461195B/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/22Matching criteria, e.g. proximity measures
    • 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
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • 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
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/10Machine learning using kernel methods, e.g. support vector machines [SVM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Software Systems (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Probability & Statistics with Applications (AREA)
  • Medical Informatics (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a picture checking method, a picture checking device and electronic equipment, wherein after a picture is uploaded, a picture processing model can be called to process the uploaded picture to obtain a picture type corresponding to the picture, so that a reference picture type of the picture can be determined from the picture type, and then a picture checking result of the picture to be tested is obtained; the picture checking result is obtained by calculation at least according to the similarity between the picture name of the picture to be checked and the class name of the reference picture class, and then whether the picture class is matched with the picture name can be determined according to the picture checking result.

Description

Picture checking method and device and electronic equipment
Technical Field
The invention relates to the field of image processing, in particular to a picture checking method and device and electronic equipment.
Background
With the development of image processing technology, the requirement for uploading pictures is higher and higher, and when a user uploads a picture, the picture and a picture name corresponding to the picture need to be uploaded, for example, an e-commerce company needs to upload a printer picture with a picture name of a printer. However, in practical applications, an error in name of the uploaded picture may occur, or an error in the uploaded picture may occur, so that the name of the uploaded picture is not matched with the name of the uploaded picture, thereby causing an error in uploading the picture.
In order to solve the problem that the uploaded picture name is not matched with the uploaded picture, so that the picture uploading error is caused, after the picture is uploaded, whether the picture name is matched with the picture can be verified manually, whether the picture or the picture name is uploaded to be wrong can be determined, and the picture name or the picture can be adjusted in time when the picture or the picture name is uploaded to be wrong. However, the mode of manually verifying whether the picture name is matched with the picture is greatly influenced by human subjectivity, so that the result of verifying whether the picture name is matched with the picture is inaccurate, and the accuracy of determining whether the picture or the picture name is uploaded wrongly is not high.
Disclosure of Invention
In view of the above, the present invention provides a picture checking method, an apparatus and an electronic device, so as to solve the problem in the prior art that a method of manually verifying whether a picture name is matched with a picture is greatly influenced by human subjectivity, so that a result of verifying whether the picture name is matched with the picture is inaccurate, and thus accuracy of determining whether the picture or the picture name is uploaded incorrectly is not high.
In order to achieve the purpose, the invention provides the following technical scheme:
a picture checking method comprises the following steps:
acquiring a picture to be tested and a picture name of the picture to be tested;
calling a pre-trained picture processing model to process the picture to be tested, and obtaining at least one picture category corresponding to the picture to be tested and a probability value corresponding to the picture category; the picture processing model is obtained by training through a training sample; the training samples comprise picture samples and picture categories corresponding to the picture samples;
selecting a reference picture category corresponding to the picture to be tested from the at least one picture category according to the probability value corresponding to the at least one picture category;
acquiring a picture checking result of the picture to be tested; the picture checking result is obtained by calculation at least according to the similarity between the picture name of the picture to be tested and the category name of the reference picture category; and the picture checking result is used as a basis for judging whether the picture to be tested is matched with the picture name of the picture to be tested.
Optionally, selecting a reference picture category corresponding to the picture to be tested from the at least one picture category according to the probability value corresponding to the at least one picture category, including:
and taking the picture category with the maximum probability value as a reference picture category corresponding to the picture to be tested.
Optionally, obtaining a picture verification result of the picture to be tested includes:
calculating a first vector corresponding to the picture name of the picture to be tested, calculating a second vector corresponding to the category name of the reference picture category, and determining cosine values of the first vector and the second vector as a picture checking result of the picture to be tested; or the like, or, alternatively,
determining a first character string corresponding to the picture name of the picture to be tested, determining a second character string corresponding to the category name of the reference picture category, and determining the Hamming distance value between the first character string and the second character string as a picture checking result of the picture to be tested; the similarity includes cosine values of the first and second vectors or hamming distance values of the first and second strings.
Optionally, selecting a reference picture category corresponding to the picture to be tested from the at least one picture category according to the probability value corresponding to the at least one picture category, including:
sorting probability values corresponding to the at least one picture category;
screening out picture categories corresponding to the probability values of the preset number before ranking, and taking the picture categories as initial picture categories;
for each initial picture category, determining the similarity between the category name of the initial picture category and the picture name of the picture to be tested;
and screening out the initial picture category with the maximum similarity, and determining the initial picture category as a reference picture category.
Optionally, obtaining a picture verification result of the picture to be tested includes:
acquiring similarity between the category name of the reference picture category and the picture name of the picture to be tested and probability value corresponding to the reference picture category;
and carrying out weighted summation on the similarity between the category name of the reference picture category and the picture name of the picture to be tested and the probability value corresponding to the reference picture category to obtain a picture checking result of the picture to be tested.
Optionally, the training process of the image processing model includes:
obtaining a training sample; the training samples comprise picture samples and picture categories corresponding to the picture samples;
and training an initial model by using the training sample to obtain the image processing model.
A picture verification apparatus, comprising:
the data acquisition module is used for acquiring a picture to be tested and a picture name of the picture to be tested;
the picture processing model is used for calling a pre-trained picture processing model to process the picture to be tested to obtain at least one picture category corresponding to the picture to be tested and a probability value corresponding to the picture category; the picture processing model is obtained by training through a training sample; the training samples comprise picture samples and picture categories corresponding to the picture samples;
the category selection module is used for selecting a reference picture category corresponding to the picture to be tested from the at least one picture category according to the probability value corresponding to the at least one picture category;
the result acquisition module is used for acquiring a picture verification result of the picture to be tested; the picture checking result is obtained by calculation at least according to the similarity between the picture name of the picture to be tested and the category name of the reference picture category; and the picture checking result is used as a basis for judging whether the picture to be tested is matched with the picture name of the picture to be tested.
Optionally, the category selection module is specifically configured to:
and taking the picture category with the maximum probability value as a reference picture category corresponding to the picture to be tested.
Optionally, the result obtaining module includes:
the first determining submodule is used for calculating a first vector corresponding to the picture name of the picture to be tested, calculating a second vector corresponding to the category name of the reference picture category, and determining cosine values of the first vector and the second vector as a picture checking result of the picture to be tested; or the like, or, alternatively,
the second determining submodule is used for determining a first character string corresponding to the picture name of the picture to be tested, determining a second character string corresponding to the category name of the reference picture category, and determining the Hamming distance value between the first character string and the second character string as the picture checking result of the picture to be tested; the similarity includes cosine values of the first and second vectors or hamming distance values of the first and second strings.
An electronic device, comprising: a memory and a processor;
wherein the memory is used for storing programs;
the processor calls a program and is used to:
acquiring a picture to be tested and a picture name of the picture to be tested;
calling a pre-trained picture processing model to process the picture to be tested, and obtaining at least one picture category corresponding to the picture to be tested and a probability value corresponding to the picture category; the picture processing model is obtained by training through a training sample; the training samples comprise picture samples and picture categories corresponding to the picture samples;
selecting a reference picture category corresponding to the picture to be tested from the at least one picture category according to the probability value corresponding to the at least one picture category;
acquiring a picture checking result of the picture to be tested; the picture checking result is obtained by calculation at least according to the similarity between the picture name of the picture to be tested and the category name of the reference picture category; and the picture checking result is used as a basis for judging whether the picture to be tested is matched with the picture name of the picture to be tested.
According to the technical scheme, the invention provides the picture checking method, the device and the electronic equipment, after the picture is uploaded, the picture processing model can be called to process the uploaded picture to obtain the picture type corresponding to the picture, so that the reference picture type of the picture can be determined from the picture type, and then the picture checking result of the picture to be tested is obtained; the picture checking result is obtained by calculation at least according to the similarity between the picture name of the picture to be checked and the class name of the reference picture class, and then whether the picture class is matched with the picture name can be determined according to the picture checking result.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for checking a picture according to an embodiment of the present invention;
fig. 2 is a flowchart of another method for verifying a picture according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a picture checking apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problem that in the prior art, a mode of manually verifying whether a picture name is matched with a picture is greatly influenced by human subjectivity, so that a result of verifying whether the picture name is matched with the picture is inaccurate, and accuracy of determining whether the picture or the picture name is uploaded mistakenly is not high, an embodiment of the invention provides a picture checking method, which can automatically check whether a picture to be tested is matched with the picture name of the picture to be tested, and specifically, referring to fig. 1, the picture checking method can include:
s11, obtaining the picture to be tested and the picture name of the picture to be tested.
In this embodiment, the picture to be tested and the picture name of the picture to be tested are uploaded by the user, for example, an e-commerce company needs to upload a printer picture with a picture name of a printer. The picture to be tested is the picture of the printer, and the picture name is the printer. In practical application, although a user wants to upload a printer picture with a picture name of a printer, the picture name may not be matched with the picture due to an error in inputting the picture name (for example, a word is printed more, a word is printed less, and a word is wrongly printed), or due to an error in selecting the picture (for example, a selected folder is wrong, or a picture adjacent to the picture to be uploaded is selected), and the picture name generally represents a picture category, and if the picture name is a jacket, a wardrobe, and the like, the printer picture appears in the categories of the jacket, the wardrobe, and the like in the e-commerce field, so that the picture uploading error in the e-commerce field is caused. Therefore, the invention automatically performs matching judgment on the picture to be tested and the picture name of the picture to be tested, and particularly refers to the steps S12-S14.
S12, calling a pre-trained picture processing model to process the pictures to be tested, and obtaining at least one picture category corresponding to the pictures to be tested and a probability value corresponding to the picture category.
In the embodiment, the similarity between the picture category and the picture name of the picture to be tested is calculated, and whether the picture to be tested is matched with the picture name is determined at least according to the similarity, because the picture name generally represents the picture type, if the picture name is similar to the picture name, the picture category and the picture name of the picture to be tested are relatively similar and are probably the same, if the picture category of the picture to be tested is a printer and the picture name is a small printer, the matching between the picture category of the picture to be tested and the picture name is relatively high, the uploading error probability between the picture to be tested and the picture name to be tested is relatively low, if the picture category and the picture name are similar to each other, the difference between the picture category of the picture to be tested and the picture name is relatively large and is probably different, if the picture category of the picture to be tested is a printer and the picture name is a jacket, the, the probability of errors in uploading the names of the pictures to be tested and the pictures to be tested is high.
Therefore, the invention needs to judge the picture category of the picture to be tested, and in practical application, a deep learning model, such as a convolutional neural network, is trained, and the convolutional neural network is used for determining the picture category of the picture to be tested.
The convolutional neural network may be generated based on the inclusion-v 3 model. The Incep-v 3 model comprises an input matrix, an Incep intermediate result and an output matrix, wherein the Incep intermediate result is constructed by an Incep structure, and the Incep structure is formed by combining different convolution layers in a parallel mode. One convolutional layer can use filters with a side length of 1, 3 or 5, while using all filters of different sizes, and then stitch the resulting matrix together. The inclusion structure will first process the input matrix using filters of different sizes. The inclusion structure may include three matrices, an upper, a middle, and a lower, the uppermost matrix may be the result of forward propagation of the convolutional layer using a filter with a side length of 1. Similarly, the middle matrix may use a filter side of 3 and the lower matrix may use a filter side of 5. The different matrices represent one computation path in the inclusion structure. Although the filters are different in size, if all filters use all 0 padding and the step size is 1, the forward propagation results in a resulting matrix that is consistent in both length and width with the input matrix. Thus, the result matrixes processed by different filters can be spliced into a deeper matrix.
The picture processing model is obtained by training through a training sample; the training samples comprise picture samples and picture categories corresponding to the picture samples.
Specifically, a large number of picture samples (also referred to as training samples) can be obtained first, and the picture samples can cover various e-commerce fields such as clothes, printers, snacks, and the like, and the picture categories of the picture samples are manually labeled, such as the above-mentioned clothes, printers, snacks, and the like. The picture samples support operations such as batch uploading, deleting and inquiring.
After the picture sample is obtained, the picture sample can be cleaned to delete the picture sample which does not meet the regulation, so that the quality of the picture sample is ensured. In addition, the number of the picture samples is as large as possible, so that the training accuracy is guaranteed.
And then, training an initial model by using the training sample to obtain the image processing model.
The initial model can be a preset convolutional neural network, and parameters in the convolutional neural network, such as learning rate, accuracy rate, path and the like, need to be manually set in advance.
And training the initial model by using the training sample to obtain the image processing model. In the actual training process, the training sample can be divided into two parts, one part is used for training, the other part is used for testing, and the proportion of the testing and the training can be manually set. Most of them are used for training and the other for testing.
And then training the initial model by using the training part to obtain a model, then testing the model by using the testing part, if the accuracy is qualified, proving that the model can be used, and if the accuracy is unqualified, re-using the training data different from the training part to train the obtained model again until the obtained accuracy is qualified.
In the training process of the image processing model, training progress data can be stored, so that a user can inquire the training progress.
After the training of the picture processing model is completed, the picture to be tested may be processed by using the picture processing model, and at least one picture category corresponding to the picture to be tested and the probability value corresponding to the picture category may be obtained, where the number of the picture categories in this embodiment may be one, for example, the picture category with the highest probability value, or multiple, for example, the first few, such as five, picture categories with the highest probability value are selected. The probability value corresponding to the picture category refers to a probability value that the picture to be tested belongs to the picture category, for example, five picture categories, namely printer, electrical equipment, furniture, clothing and snack, are output by the picture processing model, and the probability values corresponding to the picture categories are 0.8, 0.7, 0.6, 0.5 and 0.4 respectively.
It should be noted that the probability value output by the picture processing model in this embodiment may be a probability value after normalization processing.
In addition, the image processing model may use the above convolutional neural network, and may also be a machine learning model scheme based on a common algorithm, such as using a support vector machine model based on statistical theory. The support vector machine model trains a classifier according to the features extracted manually, and the aim of picture recognition is achieved through the classifier. For the extraction of bottom layer features, the method mainly comprises the steps of extracting color, shape and texture features; classifiers are constructed using binary tree classifiers. But the binary tree classifier suffers from a non-1, i.e., 0. However, the comparison experiment shows that the machine learning scheme constructed by a simple support vector machine and a binary tree model has poor image classification effect due to the fact that the network hierarchical structure is shallow. The convolutional neural network mentioned above has a relatively good effect of extracting image features due to the relatively deep network hierarchy, and thus the image recognition result is more accurate.
S13, selecting a reference picture category corresponding to the picture to be tested from the at least one picture category according to the probability value corresponding to the at least one picture category.
The reference picture category in this embodiment is the most likely picture category of the picture to be tested.
In practical application, only the probability value corresponding to the picture category may be considered, and the picture category with the highest probability value may be used as the reference picture category corresponding to the picture to be tested. That is, it is assumed that the recognition accuracy of the picture processing model is high, and the picture category having the highest probability value recognized by the picture processing model can be directly used as the reference picture category.
It should be noted that, in this embodiment, the probability value of the picture category with the largest probability value should satisfy the preset probability value corresponding to the picture category, and it is assumed that if the probability value is greater than the preset probability value, it indicates that the picture category of the picture to be tested may be the picture category, and if the probability value is not greater than the preset probability value, it indicates that the picture category of the picture to be tested may not be the picture category, that is, this identification error is indicated, and a result that the picture category is not identified is directly output. The preset probability value in this embodiment may be determined by a picture trained by the e-commerce company, and the influence factor is mainly determined by the quality of pictures uploaded by all users and the requirement of manual review by the e-commerce company.
In addition, it is assumed that the recognition accuracy of the picture processing model is high, and the picture category with the maximum probability value recognized by the picture processing model can be directly used as the reference picture category, but in practical application, in order to avoid the problem that the recognition accuracy of the picture processing model is low due to the fact that the feature values of pictures are few, and further the determination of the reference picture category of the picture to be tested is inaccurate, when the reference picture category of the picture to be tested is determined, the similarity between the category name of the picture category and the picture name of the picture to be tested can be introduced, that is, the similarity and the probability value are combined to determine the reference picture category of the picture to be tested. Specifically, referring to fig. 2, step S13 may include:
and S21, sorting the probability value corresponding to the at least one picture category.
And S22, screening the picture categories corresponding to the probability values of the preset number before ranking, and taking the picture categories as initial picture categories.
In this embodiment, in order to reduce the data processing amount, only the picture categories corresponding to the preset number of probability values before ranking may be screened, for example, the first five picture categories may be screened, if the picture processing model only outputs five picture categories, the sorting and screening operations are not performed at this time, and if the number of the picture categories is greater than five, the sorting and screening operations may be performed, and only the picture categories corresponding to the preset number of probability values before ranking are required.
After the picture categories corresponding to the preset number of probability values before ranking are screened out, the probability values corresponding to the screened picture categories need to be compared with the preset probability values corresponding to the picture categories, if the probability values are larger than the preset probability values, the picture categories are reserved, if the probability values are smaller than the preset probability values, the picture categories are removed, and the reserved picture categories serve as initial picture categories.
And S23, for each initial picture category, determining the similarity between the category name of the initial picture category and the picture name of the picture to be tested.
When calculating the similarity, two ways can be adopted, which are now introduced separately.
1. Calculating a first vector corresponding to the picture name of the picture to be tested, calculating a second vector corresponding to the category name of the initial picture category, and calculating cosine values of the first vector and the second vector.
The picture name of the picture to be tested and the category name of the initial picture category can be processed through a Word2vec model, corresponding first vectors and second vectors are obtained respectively, and then cosine values of the first vectors and the second vectors are calculated. The smaller the cosine value, the higher the token similarity.
2. Determining a first character string corresponding to the picture name of the picture to be tested, determining a second character string corresponding to the category name of the initial picture category, and calculating the Hamming distance value between the first character string and the second character string.
The picture name of the picture to be tested and the category name of the initial picture category can be respectively converted into 64-bit character strings by utilizing a simhash algorithm, and then the hamming distance values of the two character strings are calculated. The smaller the Hamming distance value is, the higher the characterization similarity is.
The similarity includes cosine values of the first and second vectors or hamming distance values of the first and second strings.
The two modes are both called that natural language processing N L P character matching is carried out on the category name of the initial picture category and the picture name of the picture to be tested, and manual review is assisted through the mode, so that labor force is reduced.
In practical application, the similarity between the category name of the initial picture category and the picture name of the picture to be tested can be calculated by adopting any one of the above manners.
And S24, screening out the initial picture category with the maximum similarity, and determining the initial picture category as a reference picture category.
In the embodiment, when the reference picture category is determined, the similarity between the category name of the initial picture category and the picture name of the picture to be tested is considered, so that the problem of inaccurate determination of the reference picture category caused by low identification accuracy of the picture processing model can be solved.
And S14, obtaining the picture verification result of the picture to be tested.
And the picture checking result is obtained by calculation at least according to the similarity between the picture name of the picture to be tested and the category name of the reference picture category.
In practical applications, there are two ways to determine the reference picture type, and there are two ways to determine the picture verification result in this embodiment.
1. For the mode that the picture category with the highest probability value is taken as the reference picture category corresponding to the picture to be tested, step S14 may include:
1) calculating a first vector corresponding to the picture name of the picture to be tested, calculating a second vector corresponding to the category name of the reference picture category, and determining cosine values of the first vector and the second vector as a picture checking result of the picture to be tested; or the like, or, alternatively,
2) determining a first character string corresponding to the picture name of the picture to be tested, determining a second character string corresponding to the category name of the reference picture category, and determining the Hamming distance value between the first character string and the second character string as a picture checking result of the picture to be tested; the similarity includes cosine values of the first and second vectors or hamming distance values of the first and second strings.
In this embodiment, the similarity is directly used as a picture verification result of the picture to be tested, and two implementation manners are adopted for similarity calculation, and the specific implementation manner can refer to the corresponding contents.
2. For this way of determining the reference picture category using the probability value in combination with the similarity, step S14 may include:
1) acquiring similarity between the category name of the reference picture category and the picture name of the picture to be tested and probability value corresponding to the reference picture category;
2) and carrying out weighted summation on the similarity between the category name of the reference picture category and the picture name of the picture to be tested and the probability value corresponding to the reference picture category to obtain a picture checking result of the picture to be tested.
In this embodiment, when determining the picture verification result of the picture to be tested, the weighted sum result of the similarity between the category name of the reference picture category and the picture name of the picture to be tested and the probability value corresponding to the reference picture category is used, so that the output result of the picture processing model has a higher reference value. In practical applications, the weighted value of the weighted sum may be set by a technician according to a specific use scenario.
It should be noted that, no matter which determination method of the picture verification result is used, the picture verification result determined in this embodiment is a numerical value, and the numerical value is used as a basis for determining whether the picture to be tested and the picture name of the picture to be tested are matched. Specifically, manually determining whether the picture to be tested is matched with the picture name of the picture to be tested according to the numerical value.
In this embodiment, after the picture is uploaded, the picture processing model may be called to process the uploaded picture to obtain a picture category corresponding to the picture, and then a reference picture category of the picture may be determined from the picture categories, and then a picture verification result of the picture to be tested is obtained; the picture checking result is obtained by calculation at least according to the similarity between the picture name of the picture to be checked and the class name of the reference picture class, and then whether the picture class is matched with the picture name can be determined according to the picture checking result. In addition, the invention can also reduce the manual participation and reduce the labor cost.
Optionally, on the basis of the embodiment of the picture checking method, another embodiment of the present invention provides a picture checking apparatus, and with reference to fig. 3, the picture checking apparatus may include:
the data acquisition module 11 is used for acquiring a picture to be tested and a picture name of the picture to be tested;
the picture processing model 12 is used for calling a pre-trained picture processing model to process the picture to be tested, so as to obtain at least one picture category corresponding to the picture to be tested and a probability value corresponding to the picture category; the picture processing model is obtained by training through a training sample; the training samples comprise picture samples and picture categories corresponding to the picture samples;
the category selection module 13 is configured to select a reference picture category corresponding to the picture to be tested from the at least one picture category according to the probability value corresponding to the at least one picture category;
a result obtaining module 14, configured to obtain a picture verification result of the picture to be tested; the picture checking result is obtained by calculation at least according to the similarity between the picture name of the picture to be tested and the category name of the reference picture category; and the picture checking result is used as a basis for judging whether the picture to be tested is matched with the picture name of the picture to be tested.
Further, the category selection module is specifically configured to:
and taking the picture category with the maximum probability value as a reference picture category corresponding to the picture to be tested.
Further, the result obtaining module comprises:
the first determining submodule is used for calculating a first vector corresponding to the picture name of the picture to be tested, calculating a second vector corresponding to the category name of the reference picture category, and determining cosine values of the first vector and the second vector as a picture checking result of the picture to be tested; or the like, or, alternatively,
the second determining submodule is used for determining a first character string corresponding to the picture name of the picture to be tested, determining a second character string corresponding to the category name of the reference picture category, and determining the Hamming distance value between the first character string and the second character string as the picture checking result of the picture to be tested; the similarity includes cosine values of the first and second vectors or hamming distance values of the first and second strings.
Further, the category selection module comprises:
the sorting submodule is used for sorting the probability value corresponding to the at least one picture category;
the first screening submodule is used for screening the picture categories corresponding to the probability values of the preset number before ranking and taking the picture categories as initial picture categories;
the similarity determining submodule is used for determining the similarity between the category name of the initial picture category and the picture name of the picture to be tested for each initial picture category;
and the second screening submodule is used for screening the initial picture category with the maximum similarity and determining the initial picture category as the reference picture category.
Further, the result obtaining module comprises:
the obtaining submodule is used for obtaining the similarity between the category name of the reference picture category and the picture name of the picture to be tested and the probability value corresponding to the reference picture category;
and the third determining submodule is used for weighting and summing the similarity between the category name of the reference picture category and the picture name of the picture to be tested and the probability value corresponding to the reference picture category to obtain the picture checking result of the picture to be tested.
Further, the system also comprises a model training module used for:
obtaining a training sample; the training samples comprise picture samples and picture categories corresponding to the picture samples;
and training an initial model by using the training sample to obtain the image processing model.
In this embodiment, after the picture is uploaded, the picture processing model may be called to process the uploaded picture to obtain a picture category corresponding to the picture, and then a reference picture category of the picture may be determined from the picture categories, and then a picture verification result of the picture to be tested is obtained; the picture checking result is obtained by calculation at least according to the similarity between the picture name of the picture to be checked and the class name of the reference picture class, and then whether the picture class is matched with the picture name can be determined according to the picture checking result. In addition, the invention can also reduce the manual participation and reduce the labor cost.
It should be noted that, for the working processes of each module and sub-module in this embodiment, please refer to the corresponding description in the above embodiments, which is not described herein again.
Optionally, on the basis of the embodiments of the picture verification method and apparatus, another embodiment of the present invention provides an electronic device, including: a memory and a processor;
wherein the memory is used for storing programs;
the processor calls a program and is used to:
acquiring a picture to be tested and a picture name of the picture to be tested;
calling a pre-trained picture processing model to process the picture to be tested, and obtaining at least one picture category corresponding to the picture to be tested and a probability value corresponding to the picture category; the picture processing model is obtained by training through a training sample; the training samples comprise picture samples and picture categories corresponding to the picture samples;
selecting a reference picture category corresponding to the picture to be tested from the at least one picture category according to the probability value corresponding to the at least one picture category;
acquiring a picture checking result of the picture to be tested; the picture checking result is obtained by calculation at least according to the similarity between the picture name of the picture to be tested and the category name of the reference picture category; and the picture checking result is used as a basis for judging whether the picture to be tested is matched with the picture name of the picture to be tested.
In this embodiment, after the picture is uploaded, the picture processing model may be called to process the uploaded picture to obtain a picture category corresponding to the picture, and then a reference picture category of the picture may be determined from the picture categories, and then a picture verification result of the picture to be tested is obtained; the picture checking result is obtained by calculation at least according to the similarity between the picture name of the picture to be checked and the class name of the reference picture class, and then whether the picture class is matched with the picture name can be determined according to the picture checking result. In addition, the invention can also reduce the manual participation and reduce the labor cost.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that an article or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such article or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in an article or device that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A picture checking method is characterized by comprising the following steps:
acquiring a picture to be tested and a picture name of the picture to be tested;
calling a pre-trained picture processing model to process the picture to be tested, and obtaining at least one picture category corresponding to the picture to be tested and a probability value corresponding to the picture category; the picture processing model is obtained by training through a training sample; the training samples comprise picture samples and picture categories corresponding to the picture samples;
selecting a reference picture category corresponding to the picture to be tested from the at least one picture category according to the probability value corresponding to the at least one picture category;
acquiring a picture checking result of the picture to be tested; the picture checking result is obtained by calculation at least according to the similarity between the picture name of the picture to be tested and the category name of the reference picture category; and the picture checking result is used as a basis for judging whether the picture to be tested is matched with the picture name of the picture to be tested.
2. The method of claim 1, wherein selecting the reference picture category corresponding to the picture to be tested from the at least one picture category according to the probability value corresponding to the at least one picture category comprises:
and taking the picture category with the maximum probability value as a reference picture category corresponding to the picture to be tested.
3. The method for verifying the picture according to claim 2, wherein obtaining the picture verification result of the picture to be tested comprises:
calculating a first vector corresponding to the picture name of the picture to be tested, calculating a second vector corresponding to the category name of the reference picture category, and determining cosine values of the first vector and the second vector as a picture checking result of the picture to be tested; or the like, or, alternatively,
determining a first character string corresponding to the picture name of the picture to be tested, determining a second character string corresponding to the category name of the reference picture category, and determining the Hamming distance value between the first character string and the second character string as a picture checking result of the picture to be tested; the similarity includes cosine values of the first and second vectors or hamming distance values of the first and second strings.
4. The method of claim 1, wherein selecting the reference picture category corresponding to the picture to be tested from the at least one picture category according to the probability value corresponding to the at least one picture category comprises:
sorting probability values corresponding to the at least one picture category;
screening out picture categories corresponding to the probability values of the preset number before ranking, and taking the picture categories as initial picture categories;
for each initial picture category, determining the similarity between the category name of the initial picture category and the picture name of the picture to be tested;
and screening out the initial picture category with the maximum similarity, and determining the initial picture category as a reference picture category.
5. The method for verifying the picture according to claim 4, wherein obtaining the picture verification result of the picture to be tested comprises:
acquiring similarity between the category name of the reference picture category and the picture name of the picture to be tested and probability value corresponding to the reference picture category;
and carrying out weighted summation on the similarity between the category name of the reference picture category and the picture name of the picture to be tested and the probability value corresponding to the reference picture category to obtain a picture checking result of the picture to be tested.
6. The method for verifying the picture according to claim 1, wherein the training process of the picture processing model comprises:
obtaining a training sample; the training samples comprise picture samples and picture categories corresponding to the picture samples;
and training an initial model by using the training sample to obtain the image processing model.
7. An image verification apparatus, comprising:
the data acquisition module is used for acquiring a picture to be tested and a picture name of the picture to be tested;
the picture processing model is used for calling a pre-trained picture processing model to process the picture to be tested to obtain at least one picture category corresponding to the picture to be tested and a probability value corresponding to the picture category; the picture processing model is obtained by training through a training sample; the training samples comprise picture samples and picture categories corresponding to the picture samples;
the category selection module is used for selecting a reference picture category corresponding to the picture to be tested from the at least one picture category according to the probability value corresponding to the at least one picture category;
the result acquisition module is used for acquiring a picture verification result of the picture to be tested; the picture checking result is obtained by calculation at least according to the similarity between the picture name of the picture to be tested and the category name of the reference picture category; and the picture checking result is used as a basis for judging whether the picture to be tested is matched with the picture name of the picture to be tested.
8. The image verification device of claim 7, wherein the category selection module is specifically configured to:
and taking the picture category with the maximum probability value as a reference picture category corresponding to the picture to be tested.
9. The picture verification device of claim 8, wherein the result obtaining module comprises:
the first determining submodule is used for calculating a first vector corresponding to the picture name of the picture to be tested, calculating a second vector corresponding to the category name of the reference picture category, and determining cosine values of the first vector and the second vector as a picture checking result of the picture to be tested; or the like, or, alternatively,
the second determining submodule is used for determining a first character string corresponding to the picture name of the picture to be tested, determining a second character string corresponding to the category name of the reference picture category, and determining the Hamming distance value between the first character string and the second character string as the picture checking result of the picture to be tested; the similarity includes cosine values of the first and second vectors or hamming distance values of the first and second strings.
10. An electronic device, comprising: a memory and a processor;
wherein the memory is used for storing programs;
the processor calls a program and is used to:
acquiring a picture to be tested and a picture name of the picture to be tested;
calling a pre-trained picture processing model to process the picture to be tested, and obtaining at least one picture category corresponding to the picture to be tested and a probability value corresponding to the picture category; the picture processing model is obtained by training through a training sample; the training samples comprise picture samples and picture categories corresponding to the picture samples;
selecting a reference picture category corresponding to the picture to be tested from the at least one picture category according to the probability value corresponding to the at least one picture category;
acquiring a picture checking result of the picture to be tested; the picture checking result is obtained by calculation at least according to the similarity between the picture name of the picture to be tested and the category name of the reference picture category; and the picture checking result is used as a basis for judging whether the picture to be tested is matched with the picture name of the picture to be tested.
CN202010229707.5A 2020-03-27 2020-03-27 Picture verification method and device and electronic equipment Active CN111461195B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010229707.5A CN111461195B (en) 2020-03-27 2020-03-27 Picture verification method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010229707.5A CN111461195B (en) 2020-03-27 2020-03-27 Picture verification method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111461195A true CN111461195A (en) 2020-07-28
CN111461195B CN111461195B (en) 2023-06-09

Family

ID=71684993

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010229707.5A Active CN111461195B (en) 2020-03-27 2020-03-27 Picture verification method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111461195B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858500A (en) * 2020-08-05 2020-10-30 北京酷豹科技有限公司 Electronic image naming method, device, equipment and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107067020A (en) * 2016-12-30 2017-08-18 腾讯科技(上海)有限公司 Image identification method and device
WO2019051941A1 (en) * 2017-09-15 2019-03-21 平安科技(深圳)有限公司 Method, apparatus and device for identifying vehicle type, and computer-readable storage medium
CN109783671A (en) * 2019-01-30 2019-05-21 京东方科技集团股份有限公司 A kind of method, computer-readable medium and server to scheme to search figure

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107067020A (en) * 2016-12-30 2017-08-18 腾讯科技(上海)有限公司 Image identification method and device
WO2019051941A1 (en) * 2017-09-15 2019-03-21 平安科技(深圳)有限公司 Method, apparatus and device for identifying vehicle type, and computer-readable storage medium
CN109783671A (en) * 2019-01-30 2019-05-21 京东方科技集团股份有限公司 A kind of method, computer-readable medium and server to scheme to search figure

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘杰;杜军平;: "一种基于迁移学习的文本―图像特征映射算法" *
李杰;方木云;: "文字识别中特征与相似度度量的研究" *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858500A (en) * 2020-08-05 2020-10-30 北京酷豹科技有限公司 Electronic image naming method, device, equipment and readable storage medium

Also Published As

Publication number Publication date
CN111461195B (en) 2023-06-09

Similar Documents

Publication Publication Date Title
US11282295B2 (en) Image feature acquisition
CN107330750B (en) A kind of recommended products figure method and device, electronic equipment
CN110533097A (en) A kind of image definition recognition methods, device, electronic equipment and storage medium
WO2021164232A1 (en) User identification method and apparatus, and device and storage medium
CN111274785B (en) Text error correction method, device, equipment and medium
CN108734159B (en) Method and system for detecting sensitive information in image
CN110991474A (en) Machine learning modeling platform
CN110738540B (en) Model clothes recommendation method based on generation of confrontation network
Akputu et al. Emotion recognition using multiple kernel learning toward E-learning applications
CN112036295A (en) Bill image processing method, bill image processing device, storage medium and electronic device
CN112329679A (en) Face recognition method, face recognition system, electronic equipment and storage medium
CN109241379A (en) A method of across Modal detection network navy
CN117355038B (en) X-shaped hole processing method and system for circuit board soft board
CN112084825B (en) Cooking evaluation method, cooking recommendation method, computer device and storage medium
CN107169830B (en) Personalized recommendation method based on clustering PU matrix decomposition
CN112559791A (en) Cloth classification retrieval method based on deep learning
CN111506798A (en) User screening method, device, equipment and storage medium
CN111401343A (en) Method for identifying attributes of people in image and training method and device for identification model
CN111461195A (en) Picture checking method and device and electronic equipment
KR102410715B1 (en) Apparatus and method for analyzing sentiment of text data based on machine learning
CN116543220A (en) Body-building scheme recommendation method, device and equipment
CN113705689A (en) Training data acquisition method and abnormal behavior recognition network training method
CN112215136A (en) Target person identification method and device, electronic equipment and storage medium
CN116932735A (en) Text comparison method, device, medium and equipment
CN115760822B (en) Image quality detection model building method and system

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
CB02 Change of applicant information

Address after: 100053 room 8018, 8 / F, building 7, Guangyi street, Xicheng District, Beijing

Applicant after: State Grid Digital Technology Holdings Co.,Ltd.

Applicant after: State Grid E-Commerce Technology Co.,Ltd.

Address before: 311 guanganmennei street, Xicheng District, Beijing 100053

Applicant before: STATE GRID ELECTRONIC COMMERCE Co.,Ltd.

Applicant before: YINGDA BUSINESS SERVICES Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant