CN109583492A - A kind of method and terminal identifying antagonism image - Google Patents

A kind of method and terminal identifying antagonism image Download PDF

Info

Publication number
CN109583492A
CN109583492A CN201811414641.6A CN201811414641A CN109583492A CN 109583492 A CN109583492 A CN 109583492A CN 201811414641 A CN201811414641 A CN 201811414641A CN 109583492 A CN109583492 A CN 109583492A
Authority
CN
China
Prior art keywords
image
target
confidence
classification
sample
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.)
Pending
Application number
CN201811414641.6A
Other languages
Chinese (zh)
Inventor
赵峰
王健宗
肖京
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811414641.6A priority Critical patent/CN109583492A/en
Publication of CN109583492A publication Critical patent/CN109583492A/en
Pending legal-status Critical Current

Links

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/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting

Landscapes

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

Abstract

The present invention is suitable for field of computer technology, provide a kind of method and terminal for identifying antagonism image, it is handled this method comprises: target image to be detected is inputted preset image classification model, obtains the target signature information and the corresponding target classification result of the target image of the target image;The target image, the target signature information and the target classification result are imported into preset KNN classifier, based on the sample image training set to the target image, the target signature information and the target classification as a result, determining the confidence of the target classification result;When the confidence is less than or equal to preset confidence threshold value, determine the target image for antagonism image.Whether the confidence recognition target image of the embodiment of the present invention, the target classification result based on target image belongs to antagonism image, can be avoided antagonism image and interferes to classification results, improves classification accuracy.

Description

A kind of method and terminal identifying antagonism image
Technical field
The invention belongs to field of computer technology more particularly to a kind of methods and terminal for identifying antagonism image.
Background technique
Image classification is sentenced generally according to the characteristics of image (such as color of image, shape, texture visual signature) extracted Disconnected image out belongs to which kind of in pre-set categories, such as landscape, personage, dining room, auditorium etc..
It is higher and higher with requiring image classification accuracy, machine learning techniques are generallyd use at present, and image is divided Class.Deep learning generally requires thousands of sample image training image disaggregated model, since training data is better, training effect Fruit is better, and the nicety of grading of image classification model is higher, in order to guarantee the effect of deep learning and ensure image classification model Can accurately it classify, sample image is needed using the image for meeting specific criteria.
However, antagonism image can be right when sample image or image to be detected are the antagonism image of malicious modification Depth god of net's channels and collaterals based on machine learning are attacked, at present because that can not identify antagonism image, so as to cause image classification The classification results of model output are the mistake classification with high confidence level, reduce the accuracy of classification results.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of method and terminal for identifying antagonism image, it is existing to solve In technology, because that can not identify antagonism image, the classification results so as to cause the output of image classification model are with high confidence level Mistake classification, the problem of reducing the accuracy of classification results.
The first aspect of the embodiment of the present invention provides a kind of method for identifying antagonism image, comprising:
Target image to be detected is inputted preset image classification model to handle, obtains the mesh of the target image Mark characteristic information and the corresponding target classification result of the target image;Wherein, described image disaggregated model be by using Machine learning algorithm is trained to obtain to sample image training set, in the training process, the input of described image disaggregated model For the image information of the sample image training set, the output of described image disaggregated model is the corresponding classification of described image sample As a result;The sample image that the sample image training set includes meets preset training requirement;
The target image, the target signature information and the target classification result are imported into preset KNN classification Device, based on the sample image training set to the target image, the target signature information and the target classification as a result, Determine the confidence of the target classification result;
When the confidence is less than or equal to preset confidence threshold value, determine that the target image is pair Resistance image.
The second aspect of the embodiment of the present invention provides a kind of terminal, comprising:
Detection unit handles for target image to be detected to be inputted preset image classification model, obtains institute State the target signature information and the corresponding target classification result of the target image of target image;Wherein, described image is classified Model is to be trained to obtain to sample image training set by using machine learning algorithm, in the training process, described image The input of disaggregated model is the image information of the sample image training set, and the output of described image disaggregated model is described image The corresponding classification results of sample;The sample image that the sample image training set includes meets preset training requirement;
Determination unit, for importing the target image, the target signature information and the target classification result Preset KNN classifier, based on the sample image training set to the target image, the target signature information and described Target classification is as a result, determine the confidence of the target classification result;
Recognition unit, for determining institute when the confidence is less than or equal to preset confidence threshold value Stating target image is antagonism image.
The third aspect of the embodiment of the present invention provides a kind of terminal, including memory, processor and is stored in described In memory and the computer program that can run on the processor, the processor are realized when executing the computer program Following steps:
Target image to be detected is inputted preset image classification model to handle, obtains the mesh of the target image Mark characteristic information and the corresponding target classification result of the target image;Wherein, described image disaggregated model be by using Machine learning algorithm is trained to obtain to sample image training set, in the training process, the input of described image disaggregated model For the image information of the sample image training set, the output of described image disaggregated model is the corresponding classification of described image sample As a result;The sample image that the sample image training set includes meets preset training requirement;
The target image, the target signature information and the target classification result are imported into preset KNN classification Device, based on the sample image training set to the target image, the target signature information and the target classification as a result, Determine the confidence of the target classification result;
When the confidence is less than or equal to preset confidence threshold value, determine that the target image is pair Resistance image.
The third aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, and the computer program performs the steps of when being executed by processor
Target image to be detected is inputted preset image classification model to handle, obtains the mesh of the target image Mark characteristic information and the corresponding target classification result of the target image;Wherein, described image disaggregated model be by using Machine learning algorithm is trained to obtain to sample image training set, in the training process, the input of described image disaggregated model For the image information of the sample image training set, the output of described image disaggregated model is the corresponding classification of described image sample As a result;The sample image that the sample image training set includes meets preset training requirement;
The target image, the target signature information and the target classification result are imported into preset KNN classification Device, based on the sample image training set to the target image, the target signature information and the target classification as a result, Determine the confidence of the target classification result;
When the confidence is less than or equal to preset confidence threshold value, determine that the target image is pair Resistance image.
Implement a kind of method for identifying antagonism image and terminal provided in an embodiment of the present invention to have the advantages that
The embodiment of the present invention handles target image to be detected using preset image classification model, obtains mesh The corresponding target classification of target signature information and target image of logo image is as a result, and be based on sample graph by KNN classifier As training set protect sample image characteristic information and known tag along sort, target image target signature information and The corresponding target classification of target image is as a result, determine the confidence of target classification result;Pass through setting for target classification result Whether confidence score recognition target image belongs to antagonism image, to avoid not meeting the antagonism image of training requirement to figure As disaggregated model interferes, classification accuracy is improved.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of implementation flow chart of the method for identification antagonism image that one embodiment of the invention provides;
Fig. 2 be another embodiment of the present invention provides a kind of identification antagonism image method implementation flow chart;
Fig. 3 is a kind of schematic diagram for terminal that one embodiment of the invention provides;
Fig. 4 be another embodiment of the present invention provides a kind of terminal schematic diagram.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
Referring to Figure 1, Fig. 1 is a kind of implementation process of method for identifying antagonism image provided in an embodiment of the present invention Figure.The executing subject that the method for antagonism image is identified in the present embodiment is terminal.Terminal includes but is not limited to smart phone, puts down The mobile terminals such as plate computer, wearable device can also be desktop computer etc..The method of identification antagonism image as shown in the figure Can include:
S101: target image to be detected is inputted into preset image classification model and is handled, the target figure is obtained The target signature information of picture and the corresponding target classification result of the target image;Wherein, described image disaggregated model is logical It crosses and sample image training set is trained to obtain using machine learning algorithm, in the training process, described image disaggregated model Input be the sample image training set image information, the output of described image disaggregated model is described image sample correspondence Classification results;The sample image for including in the sample image training set meets preset training requirement.
Terminal obtains target image to be detected, and target image can be in the training process, classify for training image The sample image of model is also possible to image to be sorted, herein with no restrictions.
The target image that terminal will acquire inputs preset image classification model and is handled, and extracts the mesh of target image Characteristic information is marked, based on classification belonging to target signature information prediction target image, and exports the corresponding target point of target image Class result.Target signature information is that the feature vector obtained after depth characteristic extraction or characteristics of image letter are carried out to target image Breath, target classification result identify class categories belonging to target image.Class categories can specifically be divided by species, but and unlimited In this.
Image classification model is the multiple sample images for including to sample image training set by using machine learning algorithm It is trained to obtain, in the training process, the input of image classification model is the image information of sample image training set, image point The output of class model is the corresponding classification results of image pattern.Belonging to the corresponding classification results mark image pattern of image pattern Class categories.The quantity for the sample image that sample image training set includes can be configured according to actual needs, not done herein Limitation.Each sample image that sample image training set includes meets preset training requirement, and each image pattern has in advance The known tag along sort first marked.Sample image meets preset training requirement and refers to: the sample that sample image training set includes This image does not pass through malicious modification adjustment, and will not create antagonism to image classification model sexual assault, lead to image classification model Classification error.
Wherein, the image classification model in the present embodiment may include input layer, hidden layer and output layer.Wherein, it inputs Layer includes at least one input layer, for receiving the image information inputted from external.Hidden layer includes more than two hidden The characteristic information of image information is extracted for handling image information containing node layer.Output layer includes an output layer section Point is used for output category result.
S102: the target image, the target signature information and the target classification result are imported into preset KNN Classifier, based on the sample image training set to the target image, the target signature information and the target classification As a result it is handled, obtains the confidence of the target classification result.
Closest (k-nearest neighbor classification, the KNN) classifier of K is carried out based on KNN algorithm The classifier of classification.The core concept of KNN algorithm is if in the k in feature space most adjacent samples of a sample Most of to belong to some classification, then the sample also belongs to this classification, and the characteristic with sample in this classification.This method It is only determined according to the classification of one or several closest samples wait divide classification belonging to sample on determining categorised decision.
Target image, target signature information and target classification result are imported the closest KNN of preset K and classified by terminal Device.Since the image that sample image training set is included meets preset training requirement, terminal can control KNN classification The target image information of each sample image, target image and target image that device includes based on sample image training set, is adopted Nearest Neighbor Search processing is carried out to target image with KNN algorithm;Based between target image and sample image similarity or away from From value, the determining and closest multiple closest images of target image are based on multiple closest corresponding contingency tables of image Label, the corresponding target classification of target image are as a result, calculate the confidence of target classification result.
Wherein, terminal can compare each pixel in sample image and target image one by one by KNN classifier, in sample Nearest Neighbor Search processing is carried out to target image in this training set of images, by comparing the phase between target image and sample image Like degree, the determining and closest multiple closest images of target image.Wherein, image pattern is more similar to target image, the two Between similarity it is higher.
Alternatively, terminal can be based on sample image training set packet when target signature information is target image characteristics vector The target image characteristics vector of the image feature vector of each sample image contained, target image, calculate each characteristics of image to The distance between amount and target image characteristics vector value, carry out at Nearest Neighbor Search target image in sample image training set Reason, the determining and closest multiple closest images of target image.The image feature vector of sample image can first pass through figure in advance As disaggregated model extracts to obtain.Wherein, image pattern is more similar to target image, the distance between image feature vector of the two It is worth smaller.Wherein, distance value is Euclidean distance value or manhatton distance value.
Further, in order to improve the treatment effeciency of KNN classifier, S102 can specifically include S1021~S1023.Tool Body is as follows:
S1021: the target image, the target signature information and the target classification result are imported preset KNN classifier calculates the distance between each sample image and the target image value in the sample image training set.
Target image, target signature information and target classification result are imported the closest KNN of preset K and classified by terminal Device, image feature vector, the target image of each sample image that control KNN classifier includes based on sample image training set Target image characteristics vector calculates the distance between each image feature vector and target image characteristics vector value, obtains sample The distance between each sample image and the target image are worth in training set of images.
Further, terminal can pass through preset range formulaCalculate sample The distance between each sample image and target image are worth in training set of images.Wherein, d (x, y) is distance value,For mesh The target image characteristics vector of logo image,For the image feature vector of sample image.It should be noted that d (x, y) It is worth smaller, target image is more similar to sample image.
It should be noted that terminal can also by manhatton distance formula d (x, y)=| x-y |, sample is calculated The distance between each sample image and target image are worth in this training set of images.Wherein x is that the target image of target image is special Vector is levied, y is the image feature vector of sample image.
It should be noted that the value of manhatton distance d (x, y) is smaller, target image is more similar to sample image.
S1022: at least two closest images of the target image are determined based on the distance value.
Terminal is worth based on the distance between each sample image and the target image, to mesh in sample image training set Logo image carries out Nearest Neighbor Search processing, all distance values is ranked up by sequence from small to large or from big to small, and base Distance value after sequence selects at least two distance values according to the sequence of distance value from small to large, will be singled out the distance come It is worth corresponding sample image and is identified as closest image.
S1023: the target classification of tag along sort and the target image based on each closest image as a result, Determine the confidence of the target classification result.
Based on the core concept of the above-mentioned KNN algorithm referred to, terminal predicts mesh when determining at least two arest neighbors images Class categories belonging to logo image are the corresponding tag along sort of arest neighbors image.
The corresponding tag along sort of each closest image is compared point by terminal with the target classification result of target image Whether analysis, the target classification result tag along sort corresponding with closest image to determine target image belong to same classification class Not, and based on all comparison results the confidence of the target classification result of target image is determined.Wherein, terminal can be with base Belong to percentage shared by same class categories in target classification result tag along sort corresponding with closest image, determines target The confidence of the target classification result of image.
Further, in order to improve the accuracy for evaluating confidence, S1023 can be specifically included: based on each institute The tag along sort of closest image and the target classification of the target image are stated as a result, calculating the mesh using preset formula Mark the confidence of classification results;The preset formula are as follows:
S (q, c) is confidence;C is the target classification as a result, q is the closest image, ciFor the sample The tag along sort of i-th of sample image in training set of images, the value of i are 1 to k, and k is positive integer;wiFor the closest figure As corresponding confidence weight;1{ci=c } it is that tag along sort based on the closest image and the target classification result are true Fixed value, when the tag along sort of the closest image is consistent with the target classification result, then 1 { ci=c } value be 1; When the tag along sort of the closest image and the target classification result are inconsistent, then 1 { ci=c } value be 0.
In the present embodiment, terminal is by the target classification of each closest image corresponding tag along sort and target image As a result it is compared analysis, determines the 1 { c of confidence of each closest image and target imagei=c }.Wherein, when most adjacent When the tag along sort of nearly image is consistent with target classification result, then its corresponding 1 { c of confidencei=c } value be 1;When most When the tag along sort of adjacent image and target classification result are inconsistent, then its corresponding 1 { c of confidencei=c } value be 0.
Later, the confidence, each most adjacent based on above-mentioned preset formula, each closest image and target image The corresponding confidence weight of nearly image, is weighted and averaged operation to all confidences, obtains target classification result Confidence.
It should be noted that due to when target image is the image for meeting training requirement, the corresponding target of target image Confidence classification usually it is higher, therefore, can be set based on the confidence for the sample image for meeting training requirement Fixed preset confidence threshold value, whether to meet preset instruction by preset confidence threshold decision detection image Practice and requires.
Optionally, terminal can also wrap before the confidence for calculating target classification result by preset formula It includes: determining the corresponding confidence weight of each closest image.
Confidence weight w corresponding for each closest imagei, terminal can be corresponding by each closest image Confidence weight wiIt is set as identical constant, can also be configured according to the corresponding distance value of each closest image, away from Smaller from being worth, corresponding confidence weight is bigger.
Further, in one embodiment, the method for the corresponding confidence weight of each closest image is determined It can be with are as follows: the corresponding confidence weight of each closest image is determined based on the sequence of the distance value.
For example, terminal can be suitable by from small to large according to the distance value that each closest image and target image determine Sequence is ranked up all closest images;Based on the sequencing numbers i of each closest image, each closest image is set Confidence weight be set as
Further, in another embodiment, the side of the corresponding confidence weight of each closest image is determined Method can be with are as follows: is based onCalculate the corresponding confidence weight of each closest image;Wherein, d (q, xi)2 For square of the distance between the closest image and the target image value.
S103: when the confidence is less than or equal to preset confidence threshold value, determine the target figure As being antagonism image.
Terminal is divided in the confidence for the target classification result for determining target image less than or equal to preset confidence level When number threshold value, determine that target image does not meet preset training requirement, target image passes through malicious modification, and target image is confrontation Property image, preset image classification model can be cheated, and then lead to point of the target image of preset image classification model output Class result is judged by accident.
The embodiment of the present invention handles target image to be detected using preset image classification model, obtains mesh The corresponding target classification of target signature information and target image of logo image is as a result, and be based on sample graph by KNN classifier As training set protect sample image characteristic information and known tag along sort, target image target signature information and The corresponding target classification of target image is as a result, determine the confidence of target classification result;Pass through setting for target classification result Whether confidence score recognition target image belongs to antagonism image, to avoid not meeting the antagonism image of training requirement to figure As disaggregated model interferes, classification accuracy is improved.
Refer to Fig. 2, Fig. 2 be another embodiment of the present invention provides a kind of identification antagonism image method realization stream Cheng Tu.S201~S203 is identical as S101~S103 in a upper embodiment in the present embodiment, referring specifically in a upper embodiment The associated description of S101~S103, does not repeat herein.The difference of the present embodiment embodiment corresponding with Fig. 1 is, the present embodiment The method of middle identification antagonism image further includes S204 after S203: when the confidence is greater than described preset set When confidence score threshold value, determine that the target image is nonantagonistic image.
Terminal is greater than preset confidence threshold value in the confidence for the target classification result for determining target image When, determine that target image meets preset training requirement, target image is nonantagonistic image.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
Referring to Fig. 3, Fig. 3 is a kind of schematic diagram for terminal that one embodiment of the invention provides.The each unit that terminal includes For executing each step in the corresponding embodiment of FIG. 1 to FIG. 2.Referring specifically in the corresponding embodiment of FIG. 1 to FIG. 2 Associated description.For ease of description, only the parts related to this embodiment are shown.Referring to Fig. 3, terminal 3 includes:
Detection unit 310 is handled for target image to be detected to be inputted preset image classification model, is obtained The target signature information of the target image and the corresponding target classification result of the target image;Wherein, described image point Class model is to be trained to obtain to sample image training set by using machine learning algorithm, in the training process, the figure As the image information that the input of disaggregated model is the sample image training set, the output of described image disaggregated model is the figure Decent corresponding classification results;The sample image that the sample image training set includes meets preset training requirement;
Determination unit 320, for leading the target image, the target signature information and the target classification result Enter preset KNN classifier, based on the sample image training set to the target image, the target signature information and institute Target classification is stated as a result, determining the confidence of the target classification result;
Recognition unit 330, for determining when the confidence is less than or equal to preset confidence threshold value The target image is antagonism image.
Further, it is determined that unit includes:
Distance value computing unit is used for the target image, the target signature information and the target classification knot Tab phenolphthaleinum enters preset KNN classifier, calculates in the sample image training set between each sample image and the target image Distance value;
Screening unit, for determining at least two closest images of the target image based on the distance value;
Confidence determination unit, for tag along sort and the target figure based on each closest image The target classification of picture is as a result, determine the confidence of the target classification result.
Further, confidence determination unit is specifically used for: the tag along sort based on each closest image And the target classification of the target image is as a result, calculate the confidence level point of the target classification result using preset formula Number;The preset formula are as follows:
S (q, c) is confidence;C is the target classification as a result, q is the closest image, ciFor the sample The tag along sort of i-th of sample image in training set of images, the value of i are 1 to k, and k is positive integer;wiFor the closest figure As corresponding confidence weight;1{ci=c } it is that tag along sort based on the closest image and the target classification result are true Fixed value, when the tag along sort of the closest image is consistent with the target classification result, then 1 { ci=c } value be 1; When the tag along sort of the closest image and the target classification result are inconsistent, then 1 { ci=c } value be 0.
Optionally, terminal further include:
Weight determining unit, for determining the corresponding confidence weight of each closest image.
Further, weight determining unit is specifically used for: based on the distance value sequence determine it is each described closest The corresponding confidence weight of image.
Further, weight determining unit is specifically used for: being based onCalculate each closest image Corresponding confidence weight;Wherein, d (q, xi)2For the flat of the distance between the closest image and the target image value Side.
Fig. 4 be another embodiment of the present invention provides a kind of terminal schematic diagram.As shown in figure 4, the terminal 4 of the embodiment Include: processor 40, memory 41 and is stored in the calculating that can be run in the memory 41 and on the processor 40 Machine program 42.The processor 40 realizes the identification antagonism image of above-mentioned each terminal when executing the computer program 42 Step in embodiment of the method, such as S101 shown in FIG. 1 to S103.Alternatively, the processor 40 executes the computer journey The function of each unit in above-mentioned each Installation practice, such as the function of unit 310 to 330 shown in Fig. 3 are realized when sequence 42.
Illustratively, the computer program 42 can be divided into one or more units, one or more of Unit is stored in the memory 41, and is executed by the processor 40, to complete the present invention.One or more of lists Member can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing the computer journey Implementation procedure of the sequence 42 in the terminal 4.For example, the computer program 42 can be divided into detection unit, determine list Member and recognition unit, each unit concrete function are as described above.
The terminal may include, but be not limited only to, processor 40, memory 41.It will be understood by those skilled in the art that figure 4 be only the example of terminal 4, and the not restriction of structure paired terminal 4 may include components more more or fewer than diagram, or Combine certain components or different components, for example, the terminal can also include input/output terminal, network insertion terminal, Bus etc..
Alleged processor 40 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 41 can be the internal storage unit of the terminal 4, such as the hard disk or memory of terminal 4.It is described Memory 41 is also possible to the external storage terminal of the terminal 4, such as the plug-in type hard disk being equipped in the terminal 4, intelligence Storage card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) Deng.Further, the memory 41 can also both including the terminal 4 internal storage unit and also including external storage end End.The memory 41 is for other programs and data needed for storing the computer program and the terminal.It is described to deposit Reservoir 41 can be also used for temporarily storing the data that has exported or will export.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of method for identifying antagonism image characterized by comprising
Target image to be detected is inputted preset image classification model to handle, the target for obtaining the target image is special Reference breath and the corresponding target classification result of the target image;Wherein, described image disaggregated model is by using machine Learning algorithm is trained to obtain to sample image training set, and in the training process, the input of described image disaggregated model is institute The image information of sample image training set is stated, the output of described image disaggregated model is the corresponding classification knot of described image sample Fruit;The sample image that the sample image training set includes meets preset training requirement;
The target image, the target signature information and the target classification result are imported into preset KNN classifier, base In the sample image training set to the target image, the target signature information and the target classification as a result, determining The confidence of the target classification result;
When the confidence is less than or equal to preset confidence threshold value, determine the target image for antagonism Image.
2. the method according to claim 1, wherein described by the target image, the target signature information And the target classification result imports preset KNN classifier, based on the sample image training set to the target image, The target signature information and the target classification are as a result, determine the confidence of the target classification result, comprising:
The target image, the target signature information and the target classification result are imported into preset KNN classifier, meter Calculate the distance between each sample image and the target image value in the sample image training set;
At least two closest images of the target image are determined based on the distance value;
The target classification of tag along sort and the target image based on each closest image is as a result, determine the mesh Mark the confidence of classification results.
3. according to the method described in claim 2, it is characterized in that, the tag along sort based on each closest image And the target classification of the target image is as a result, determine the confidence of the target classification result, comprising:
The target classification of tag along sort and the target image based on each closest image is as a result, using preset Formula calculates the confidence of the target classification result;The preset formula are as follows:
S (q, c) is confidence;C is the target classification as a result, q is the closest image, ciFor the sample image The tag along sort of i-th of sample image in training set, the value of i are 1 to k, and k is positive integer;wiFor the closest image pair The confidence weight answered;1{ci=c } it is to be determined based on the tag along sort of the closest image and the target classification result Value, when the tag along sort of the closest image is consistent with the target classification result, then 1 { ci=c } value be 1;Work as institute When stating the tag along sort and the inconsistent target classification result of closest image, then 1 { ci=c } value be 0.
4. according to the method described in claim 3, it is characterized in that, the tag along sort based on the closest image and The target classification of the target image as a result, using preset formula calculate the target classification result confidence it Before, further includes:
Determine the corresponding confidence weight of each closest image.
5. according to the method described in claim 4, it is characterized in that, the corresponding confidence of each closest image of the determination Spend weight, comprising:
The corresponding confidence weight of each closest image is determined based on the sequence of the distance value.
6. according to the method described in claim 4, it is characterized in that, the corresponding confidence of each closest image of the determination Spend weight, comprising:
It is based onCalculate the corresponding confidence weight of each closest image;Wherein, d (q, xi)2For institute State square of the distance between closest image and the target image value.
7. method according to any one of claims 1 to 6, which is characterized in that further include:
When the confidence is greater than the preset confidence threshold value, determine that the target image is nonantagonistic Image.
8. a kind of terminal characterized by comprising
Detection unit handles for target image to be detected to be inputted preset image classification model, obtains the mesh The target signature information of logo image and the corresponding target classification result of the target image;Wherein, described image disaggregated model It is to be trained to obtain to sample image training set by using machine learning algorithm, in the training process, described image classification The input of model is the image information of the sample image training set, and the output of described image disaggregated model is described image sample Corresponding classification results;The sample image that the sample image training set includes meets preset training requirement;
Determination unit, it is default for importing the target image, the target signature information and the target classification result KNN classifier, based on the sample image training set to the target image, the target signature information and the target Classification results determine the confidence of the target classification result;
Recognition unit, for determining the mesh when the confidence is less than or equal to preset confidence threshold value Logo image is antagonism image.
9. a kind of terminal, which is characterized in that in the memory and can be at the place including memory, processor and storage The computer program run on reason device, the processor realize following steps when executing the computer program:
Target image to be detected is inputted preset image classification model to handle, the target for obtaining the target image is special Reference breath and the corresponding target classification result of the target image;Wherein, described image disaggregated model is by using machine Learning algorithm is trained to obtain to sample image training set, and in the training process, the input of described image disaggregated model is institute The image information of sample image training set is stated, the output of described image disaggregated model is the corresponding classification knot of described image sample Fruit;The sample image that the sample image training set includes meets preset training requirement;
The target image, the target signature information and the target classification result are imported into preset KNN classifier, base In the sample image training set to the target image, the target signature information and the target classification as a result, determining The confidence of the target classification result;
When the confidence is less than or equal to preset confidence threshold value, determine the target image for antagonism Image.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as claim 1 to 7 of realization the method.
CN201811414641.6A 2018-11-26 2018-11-26 A kind of method and terminal identifying antagonism image Pending CN109583492A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811414641.6A CN109583492A (en) 2018-11-26 2018-11-26 A kind of method and terminal identifying antagonism image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811414641.6A CN109583492A (en) 2018-11-26 2018-11-26 A kind of method and terminal identifying antagonism image

Publications (1)

Publication Number Publication Date
CN109583492A true CN109583492A (en) 2019-04-05

Family

ID=65923968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811414641.6A Pending CN109583492A (en) 2018-11-26 2018-11-26 A kind of method and terminal identifying antagonism image

Country Status (1)

Country Link
CN (1) CN109583492A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175646A (en) * 2019-05-27 2019-08-27 浙江工业大学 Multichannel confrontation sample testing method and device based on image transformation
CN110443267A (en) * 2019-05-28 2019-11-12 浙江大华技术股份有限公司 Erroneous detection filter method, device, filming apparatus and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107085585A (en) * 2016-02-12 2017-08-22 奥多比公司 Accurate label dependency prediction for picture search
CN107451616A (en) * 2017-08-01 2017-12-08 西安电子科技大学 Multi-spectral remote sensing image terrain classification method based on the semi-supervised transfer learning of depth
CN107463951A (en) * 2017-07-19 2017-12-12 清华大学 A kind of method and device for improving deep learning model robustness
CN107690659A (en) * 2016-12-27 2018-02-13 深圳前海达闼云端智能科技有限公司 A kind of image identification system and image-recognizing method
CN108491754A (en) * 2018-02-02 2018-09-04 泉州装备制造研究所 A kind of dynamic representation based on skeleton character and matched Human bodys' response method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107085585A (en) * 2016-02-12 2017-08-22 奥多比公司 Accurate label dependency prediction for picture search
CN107690659A (en) * 2016-12-27 2018-02-13 深圳前海达闼云端智能科技有限公司 A kind of image identification system and image-recognizing method
CN107463951A (en) * 2017-07-19 2017-12-12 清华大学 A kind of method and device for improving deep learning model robustness
CN107451616A (en) * 2017-08-01 2017-12-08 西安电子科技大学 Multi-spectral remote sensing image terrain classification method based on the semi-supervised transfer learning of depth
CN108491754A (en) * 2018-02-02 2018-09-04 泉州装备制造研究所 A kind of dynamic representation based on skeleton character and matched Human bodys' response method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CHANGGENG LI,等: "An Improved Weighted K-Nearest Neighbor Algorithm for Indoor Positioning", WIRELESS PERS COMMUN (2017), vol. 2, no. 96, 10 May 2017 (2017-05-10), pages 2239 - 2251 *
KLAUS HECHENBICHLER,等: "Weighted k-Nearest-Neighbor Techniques and Ordinal Classification", OPEN ACCESS LMU, 13 October 2004 (2004-10-13), pages 1 - 16 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175646A (en) * 2019-05-27 2019-08-27 浙江工业大学 Multichannel confrontation sample testing method and device based on image transformation
CN110175646B (en) * 2019-05-27 2021-05-11 浙江工业大学 Multi-channel confrontation sample detection method and device based on image transformation
CN110443267A (en) * 2019-05-28 2019-11-12 浙江大华技术股份有限公司 Erroneous detection filter method, device, filming apparatus and storage medium

Similar Documents

Publication Publication Date Title
TWI677852B (en) A method and apparatus, electronic equipment, computer readable storage medium for extracting image feature
CN110070067A (en) The training method of video classification methods and its model, device and electronic equipment
JP2020501238A (en) Face detection training method, apparatus and electronic equipment
CN106022317A (en) Face identification method and apparatus
CN109376786A (en) A kind of image classification method, device, terminal device and readable storage medium storing program for executing
CN110399890A (en) Image-recognizing method, device, electronic equipment and readable storage medium storing program for executing
CN107766822A (en) Electronic installation, facial image cluster seeking method and computer-readable recording medium
CN109117879A (en) Image classification method, apparatus and system
JP6897749B2 (en) Learning methods, learning systems, and learning programs
CN110135505A (en) Image classification method, device, computer equipment and computer readable storage medium
CN110874604A (en) Model training method and terminal equipment
CN109886295A (en) A kind of butterfly recognition methods neural network based and relevant device
CN110751027B (en) Pedestrian re-identification method based on deep multi-instance learning
CN107067022B (en) Method, device and equipment for establishing image classification model
CN109993042A (en) A kind of face identification method and its device
CN109522970A (en) Image classification method, apparatus and system
CN109165666A (en) Multi-tag image classification method, device, equipment and storage medium
WO2023116565A1 (en) Method for intelligently designing network security architecture diagram
CN111178196B (en) Cell classification method, device and equipment
CN109583492A (en) A kind of method and terminal identifying antagonism image
CN108537270A (en) Image labeling method, terminal device and storage medium based on multi-tag study
CN113255604B (en) Pedestrian re-identification method, device, equipment and medium based on deep learning network
CN108229692B (en) Machine learning identification method based on dual contrast learning
CN110175500A (en) Refer to vein comparison method, device, computer equipment and storage medium
CN110866136B (en) Face image stacking method and device, electronic equipment and readable storage medium

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