CN110211094B - Intelligent judging method and device for black eye and computer readable storage medium - Google Patents

Intelligent judging method and device for black eye and computer readable storage medium Download PDF

Info

Publication number
CN110211094B
CN110211094B CN201910370457.4A CN201910370457A CN110211094B CN 110211094 B CN110211094 B CN 110211094B CN 201910370457 A CN201910370457 A CN 201910370457A CN 110211094 B CN110211094 B CN 110211094B
Authority
CN
China
Prior art keywords
sample set
black eye
data
gradient
negative 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.)
Active
Application number
CN201910370457.4A
Other languages
Chinese (zh)
Other versions
CN110211094A (en
Inventor
姜禹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910370457.4A priority Critical patent/CN110211094B/en
Publication of CN110211094A publication Critical patent/CN110211094A/en
Application granted granted Critical
Publication of CN110211094B publication Critical patent/CN110211094B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30004Biomedical image processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Radiology & Medical Imaging (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Medical Informatics (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Quality & Reliability (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to an artificial intelligence technology, and discloses an intelligent judging method for black eye, which comprises the following steps: receiving a face image set, wherein the face image set is divided into a positive sample set and a negative sample set through a label set, the positive sample set and the negative sample set are preprocessed, the label set is input into a black eye judgment model, the data of the positive sample set and the negative sample set are subjected to direction gradient direct operation and then are input into the black eye judgment model, the black eye judgment model is trained based on a support vector machine algorithm, and training is stopped until a loss function value in the support vector machine algorithm is smaller than a threshold value; and receiving a test set of the user to the black eye judgment model to judge whether the black eye exists or not, and outputting a result. The invention also provides an intelligent judging device for the black eye and a computer readable storage medium. The invention can realize the accurate intelligent judging function of the black eye.

Description

Intelligent judging method and device for black eye and computer readable storage medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a method and a device for automatically and intelligently judging black eyes based on face data input and a computer readable storage medium.
Background
The black eye is caused by night stay, large mood fluctuation, eye fatigue and aging, which cause the blood flow velocity of blood vessels of the skin of eyes to be too slow to form stagnation, insufficient oxygen supply of tissues, excessive accumulation of metabolic wastes in blood vessels and eye pigmentation. The older the person, the thinner the subcutaneous fat around the eyes becomes, so the more visible is the dark circles. In the current society, many people have black eyes but are not self-aware, so that whether the black eyes exist is judged, however, the accurate identification of the black eyes has many problems, such as the majority of application scenes are complex, the difficulty in identification is increased due to the local dynamic change of the background, the target shadow caused by uneven illumination and the like, in addition, the face is a non-rigid target and has rich gesture characteristics, and different gestures of the same face often have large differences in detection and identification.
Disclosure of Invention
The invention provides an intelligent judging method and device for black eyes and a computer readable storage medium, and mainly aims to provide a scheme for realizing an accurate intelligent judging function for black eyes.
In order to achieve the above object, the invention provides an intelligent judging method for black eye, comprising the following steps:
the data receiving layer receives a face image set, the face image set is divided into a positive sample set and a negative sample set through a label set, preprocessing operations comprising graying, binarizing and noise reduction are carried out on the positive sample set and the negative sample set, and the positive sample set, the negative sample set and the label set which are subjected to preprocessing are input to the data processing layer;
the data processing layer receives the positive sample set, the negative sample set and the label set which are subjected to pretreatment, inputs the label set into a black eye judgment model, carries out direct gradient square operation on the data of the positive sample set and the negative sample set, and then inputs the data into the black eye judgment model, and the black eye judgment model trains the negative sample set and the positive sample set based on a support vector machine algorithm until a loss function value in the support vector machine algorithm is smaller than a threshold value, and quits training;
receiving a test set of a user, mapping data in the test set to a high-dimensional space based on a nonlinear mapping method, performing direct gradient square operation on the mapped test set, inputting the direct gradient square operation to the black eye judgment model to judge whether the black eye exists or not, and outputting a result.
Optionally, the data in the positive sample set is a face including dark circles, and the data in the negative sample set is a face not including dark circles.
Optionally, the noise reduction processing adopts an adaptive image noise reduction filtering method:
g(x,y)=η(x,y)+f(x,y)
Figure BDA0002049758810000021
wherein (x, y) represents the coordinates of the pixel point of the image, f(x, y) is output data obtained by denoising the positive sample set and the negative sample set based on the adaptive image denoising filter method, η (x, y) is noise, g (x, y) is the positive sample set and the negative sample set,
Figure BDA0002049758810000022
for the total noise variance of the positive and negative sample sets, +.>
Figure BDA0002049758810000023
Is the pixel gray average value of the (x, y), is->
Figure BDA0002049758810000024
For the pixel gray variance of (x, y), L represents the current pixel point coordinates.
Optionally, the data of the positive sample set and the negative sample set are input to a black eye judgment model after being subjected to a direct gradient square operation, including:
calculating gradient amplitude values and gradient direction values of all pixel points (x, y) of data in the face image set, and forming a gradient matrix by taking the gradient amplitude values as first components and the gradient direction values as second components;
dividing the data in the gradient matrix into a plurality of small blocks, adding the gradient amplitude value and the gradient direction value of each small block, connecting the added values in series to form a gradient direction straight feature, and inputting the gradient direction straight feature into a black eye judgment model.
Optionally, the support vector machine algorithm includes a nonlinear mapping and constraint solving;
the nonlinear mapping is:
κ(x i ,x j )=<θ(x i ),θ(x j )>
wherein,,<θ(x i ),θ(x j )>represents the gradient direction square characteristic (x i ,x j ) Inner product calculation of nonlinear mapping, κ (x i ,x j ) For the gradient direction square feature (x i ,x j ) Is a non-linear mapping function of (2);
the constraint solution is as follows:
Figure BDA0002049758810000025
Figure BDA0002049758810000031
wherein alpha is i ≥0,i=1,2,...m
Wherein m is the number of the gradient direction rectangularity features, alpha i ,α j Lagrangian number multiplied by a factor, y, solved for the constraint i ,y j Labels for the positive and negative samples, s.t, are constraints.
In addition, in order to achieve the above object, the present invention also provides an intelligent black eye judging device, which includes a memory and a processor, wherein the memory stores an intelligent black eye judging program capable of running on the processor, and the intelligent black eye judging program when executed by the processor implements the following steps:
the data receiving layer receives a face image set, the face image set is divided into a positive sample set and a negative sample set through a label set, preprocessing operations comprising graying, binarizing and noise reduction are carried out on the positive sample set and the negative sample set, and the positive sample set, the negative sample set and the label set which are subjected to preprocessing are input to the data processing layer;
the data processing layer receives the positive sample set, the negative sample set and the label set which are subjected to pretreatment, inputs the label set into a black eye judgment model, carries out direct gradient square operation on the data of the positive sample set and the negative sample set, and then inputs the data into the black eye judgment model, and the black eye judgment model trains the negative sample set and the positive sample set based on a support vector machine algorithm until a loss function value in the support vector machine algorithm is smaller than a threshold value, and quits training;
receiving a test set of a user, mapping data in the test set to a high-dimensional space based on a nonlinear mapping method, performing direct gradient square operation on the mapped test set, inputting the direct gradient square operation to the black eye judgment model to judge whether the black eye exists or not, and outputting a result.
Optionally, the data in the positive sample set is a face including dark circles, and the data in the negative sample set is a face not including dark circles.
Optionally, the noise reduction processing adopts an adaptive image noise reduction filtering method:
g(x,y)=η(x,y)+f(x,y)
Figure BDA0002049758810000032
wherein (x, y) represents coordinates of pixel points of an image, f (x, y) is output data obtained by performing noise reduction processing on the positive sample set and the negative sample set based on the adaptive image noise reduction filtering method, eta (x, y) is noise, g (x, y) is the positive sample set and the negative sample set,
Figure BDA0002049758810000033
for the total noise variance of the positive and negative sample sets, +.>
Figure BDA0002049758810000034
Is the pixel gray average value of the (x, y), is->
Figure BDA0002049758810000035
For the pixel gray variance of (x, y), L represents the current pixel point coordinates.
Optionally, the data of the positive sample set and the negative sample set are input to a black eye judgment model after being subjected to a direct gradient square operation, including:
calculating gradient amplitude values and gradient direction values of all pixel points (x, y) of data in the face image set, and forming a gradient matrix by taking the gradient amplitude values as first components and the gradient direction values as second components;
dividing the data in the gradient matrix into a plurality of small blocks, adding the gradient amplitude value and the gradient direction value of each small block, connecting the added values in series to form a gradient direction straight feature, and inputting the gradient direction straight feature into a black eye judgment model.
Optionally, the support vector machine algorithm includes a nonlinear mapping and constraint solving;
the nonlinear mapping is:
κ(x i ,x j )=<θ(x i ),θ(x j )>
wherein < θ (x i ),θ(x j )>Represents the gradient direction square characteristic (x i ,x j ) Inner product calculation of nonlinear mapping, κ (x i ,x j ) For the gradient direction square feature (x i ,x j ) Is a non-linear mapping function of (2);
the constraint solution is as follows:
Figure BDA0002049758810000041
Figure BDA0002049758810000042
wherein alpha is i ≥0,i=1,2,...m
Wherein m is the number of the gradient direction rectangularity features, alpha i ,α j Lagrangian number multiplied by a factor, y, solved for the constraint i ,y j Labels for the positive and negative samples, s.t, are constraints.
In addition, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a black eye intelligent judgment program executable by one or more processors to implement the steps of the black eye intelligent judgment method as described above.
The invention provides an intelligent judging method and device for black eyes and a computer readable storage medium, wherein a data receiving layer receives a face image set, the face image set is divided into a positive sample set and a negative sample set by a label set, and the positive sample set, the negative sample set and the label set are input to a data processing layer; the data processing layer receives the positive sample set, the negative sample set and the label set which are subjected to pretreatment, inputs the label set into a black eye judgment model, carries out direct gradient square operation on the data of the positive sample set and the negative sample set, and then inputs the data into the black eye judgment model, and the black eye judgment model trains the negative sample set and the positive sample set based on a support vector machine algorithm until a loss function value in the support vector machine algorithm is smaller than a threshold value, and quits training; receiving a test set of a user, mapping data in the test set to a high-dimensional space based on a nonlinear mapping method, performing direct gradient square operation on the mapped test set, inputting the direct gradient square operation to the black eye judgment model to judge whether the black eye exists or not, and outputting a result. The invention has the advantages that the support vector machine model with higher use efficiency is used, and the noise affecting the judgment of the model is reduced based on a plurality of data preprocessing methods in the early stage, so that the invention can realize the accurate intelligent judgment function of the black eye.
Drawings
Fig. 1 is a flow chart of an intelligent judging method for black eye according to an embodiment of the invention;
fig. 2 is a schematic diagram of an internal structure of an intelligent judging device for black eye according to an embodiment of the present invention;
fig. 3 is a schematic block diagram of an intelligent judging procedure for black eye in the intelligent judging device for black eye according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The invention provides an intelligent judging method for black eye. Referring to fig. 1, a flow chart of an intelligent judging method for black eye according to an embodiment of the invention is shown. The method may be performed by an apparatus, which may be implemented in software and/or hardware.
In this embodiment, the method for intelligently judging the black eye includes: (step according to the corresponding modification of the claims)
S1, a data receiving layer receives a face image set, the face image set is divided into a positive sample set and a negative sample set through a label set, preprocessing operations comprising graying, binarizing and noise reduction are carried out on the positive sample set and the negative sample set, and then the positive sample set, the negative sample set and the label set which are subjected to preprocessing are input to a data processing layer.
In the preferred embodiment of the present invention, the data in the positive sample set is a face including dark circles, and the data in the negative sample set is a face not including dark circles.
In a preferred embodiment of the present invention, the graying operation is to convert the data in the positive sample set and the negative sample from RGB format to black-and-white gray format by using a scaling method. The ratio method is as follows: acquiring R, G, B pixel values of each pixel point in the positive sample set and the negative sample, and converting the pixel points into a black-white gray format according to the following function:
0.30*R+0.59*G+0.11*B。
the binarization operation includes setting a threshold value first, when a pixel in the black-and-white gray format is larger than the threshold value, the pixel becomes 255, and when the pixel in the black-and-white gray format is smaller than the threshold value, the pixel becomes 0, that is, the black-and-white format indicates that the pixel values of the positive sample set and the negative sample set are 0 or 255.
The noise reduction is to perform noise reduction processing on the black-and-white format data based on an adaptive image noise reduction filtering method, and the adaptive image noise reduction filtering method is as follows:
g(x,y)=η(x,y)+f(x,y)
Figure BDA0002049758810000061
wherein (x, y) represents the coordinates of the pixel points of the image, and f (x, y) represents the processing of the black-and-white format data based on the adaptive image noise reduction filtering methodThe output data after the line noise reduction processing, eta (x, y) is noise, g (x, y) is the black-and-white format data,
Figure BDA0002049758810000062
for the noise total variance of the black and white format data, < >>
Figure BDA0002049758810000063
Is the pixel gray average value of the (x, y), is->
Figure BDA0002049758810000064
For the pixel gray variance of (x, y), L represents the current pixel point coordinates.
S2, the data processing layer receives the positive sample set and the negative sample set which are subjected to pretreatment and the label set, inputs the label set into a black eye judgment model, carries out direct gradient square operation on the data of the positive sample set and the negative sample set, and inputs the data into the black eye judgment model, and the black eye judgment model trains the negative sample set and the positive sample set based on a support vector machine algorithm until a loss function value in the support vector machine algorithm is smaller than a threshold value, and quits training.
In a preferred embodiment of the present invention, the data of the positive sample set and the negative sample set are input to the black eye judgment model after being subjected to a direction gradient direct operation, including: calculating gradient amplitude values and gradient direction values of all pixel points (x, y) of data in the face image set, and forming a gradient matrix by taking the gradient amplitude values as first components and the gradient direction values as second components; dividing the data in the gradient matrix into a plurality of small blocks, calculating the sum of the gradient amplitude and the gradient direction value of each small block, and inputting the sum in series to the black eye judgment model to form a gradient direction straight feature.
The support vector machine algorithm in the preferred embodiment of the invention comprises nonlinear mapping and constraint solving;
the nonlinear mapping is:
κ(x i ,x j )=<θ(x i ),θ(xj)>
wherein,,<θ(x i ),θ(x j )>represents the gradient direction square characteristic (x i ,x j ) Inner product calculation of nonlinear mapping, κ (x i ,x j ) For the gradient direction square feature (x i ,x j ) Is a non-linear mapping function of (2);
the constraint solution is as follows:
Figure BDA0002049758810000071
Figure BDA0002049758810000072
wherein alpha is i ≥0,i=1,2,...m
Wherein m is the number of the gradient direction rectangularity features, alpha i ,α j Lagrangian number multiplied by a factor, y, solved for the constraint i ,y j Labels for the positive and negative samples, s.t, are constraints.
In the preferred embodiment of the present invention, the loss function is a least square method, and the loss function value is L (e):
Figure BDA0002049758810000073
wherein e is the error value between the training value of the black eye judgment model and the label set, k is the total number of the positive sample set and the negative sample set, y i For the tag set, y' i For the training value, the threshold is typically set to 0.01.
S3, receiving a test set of a user, mapping data in the test set to a high-dimensional space based on a nonlinear mapping method, performing direct gradient square operation on the mapped test set, inputting the direct gradient square operation to the black eye judgment model to judge whether the black eye exists or not, and outputting a result.
The data mapping in the preferred embodiment of the invention adopts the nonlinear mapping method of the support vector machine.
The invention also provides an intelligent judging device for the black eye. Referring to fig. 2, an internal structure diagram of an intelligent judging device for black eye according to an embodiment of the invention is shown.
In this embodiment, the black eye intelligent judging device 1 may be a PC (Personal Computer ), or a terminal device such as a smart phone, a tablet computer, a portable computer, or a server. The black eye intelligent judging device 1 at least comprises a memory 11, a processor 12, a communication bus 13 and a network interface 14.
The memory 11 includes at least one type of readable storage medium including flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the black eye smart determination device 1, for example a hard disk of the black eye smart determination device 1. The memory 11 may also be an external storage device of the black eye Smart determination apparatus 1 in other embodiments, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like provided on the black eye Smart determination apparatus 1. Further, the memory 11 may also include both an internal memory unit and an external memory device of the black eye intelligent judging apparatus 1. The memory 11 may be used not only for storing application software installed in the black eye intelligent judging apparatus 1 and various types of data, for example, codes of the black eye intelligent judging program 01 and the like, but also for temporarily storing data that has been output or is to be output.
The processor 12 may in some embodiments be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing data stored in the memory 11, for example for executing the black eye intelligent judging program 01, etc.
The communication bus 13 is used to enable connection communication between these components.
The network interface 14 may optionally comprise a standard wired interface, a wireless interface (e.g. WI-FI interface), typically used to establish a communication connection between the apparatus 1 and other electronic devices.
Optionally, the device 1 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-emitting diode) touch, or the like. The display may also be referred to as a display screen or a display unit, as appropriate, for displaying information processed in the black eye intelligent judgment device 1 and for displaying a visual user interface.
Fig. 2 shows only the black eye intelligent judging device 1 having the components 11-14 and the black eye intelligent judging program 01, and it will be understood by those skilled in the art that the structure shown in fig. 1 does not constitute a limitation of the black eye intelligent judging device 1, and may include fewer or more components than shown, or may combine some components, or may be a different arrangement of components.
In the embodiment of the device 1 shown in fig. 2, the memory 11 stores therein an intelligent judgment program 01 for black eye; the processor 12 performs the following steps when executing the black eye intelligent judging program 01 stored in the memory 11:
step one, a data receiving layer receives a face image set, wherein the face image set is divided into a positive sample set and a negative sample set through a label set, preprocessing operations comprising graying, binarizing and noise reduction are carried out on the positive sample set and the negative sample set, and then the positive sample set, the negative sample set and the label set which are subjected to preprocessing are input to a data processing layer.
In the preferred embodiment of the present invention, the data in the positive sample set is a face including dark circles, and the data in the negative sample set is a face not including dark circles.
In a preferred embodiment of the present invention, the graying operation is to convert the data in the positive sample set and the negative sample from RGB format to black-and-white gray format by using a scaling method. The ratio method is as follows: acquiring R, G, B pixel values of each pixel point in the positive sample set and the negative sample, and converting the pixel points into a black-white gray format according to the following function:
0.30*R+0.59*G+0.11*B
the binarization operation includes setting a threshold value first, when a pixel in the black-and-white gray format is larger than the threshold value, the pixel becomes 255, and when the pixel in the black-and-white gray format is smaller than the threshold value, the pixel becomes 0, that is, the black-and-white format indicates that the pixel values of the positive sample set and the negative sample set are 0 or 255.
The noise reduction is to perform noise reduction processing on the black-and-white format data based on an adaptive image noise reduction filtering method, and the adaptive image noise reduction filtering method is as follows:
g(x,y)=η(x,y)+f(x,y)
Figure BDA0002049758810000091
wherein (x, y) represents coordinates of pixel points of an image, f (x, y) is output data obtained by performing noise reduction processing on the black-and-white format data based on an adaptive image noise reduction filtering method, eta (x, y) is noise, g (x, y) is the black-and-white format data,
Figure BDA0002049758810000092
for the noise total variance of the black and white format data, < >>
Figure BDA0002049758810000093
Is the pixel gray average value of the (x, y), is->
Figure BDA0002049758810000094
For the pixel gray variance of (x, y), L represents the current pixel point coordinates.
Step two, the data processing layer receives the positive sample set and the negative sample set which are subjected to pretreatment and the label set, inputs the label set into a black eye judgment model, carries out direct gradient square operation on the data of the positive sample set and the negative sample set, and inputs the data into the black eye judgment model, and the black eye judgment model trains the negative sample set and the positive sample set based on a support vector machine algorithm until a loss function value in the support vector machine algorithm is smaller than a threshold value, and quits training.
In a preferred embodiment of the present invention, the data of the positive sample set and the negative sample set are input to the black eye judgment model after being subjected to a direction gradient direct operation, including: calculating gradient amplitude values and gradient direction values of all pixel points (x, y) of data in the face image set, and forming a gradient matrix by taking the gradient amplitude values as first components and the gradient direction values as second components; dividing the data in the gradient matrix into a plurality of small blocks, calculating the sum of the gradient amplitude and the gradient direction value of each small block, and inputting the sum in series to the black eye judgment model to form a gradient direction straight feature.
The support vector machine algorithm in the preferred embodiment of the invention comprises nonlinear mapping and constraint solving;
the nonlinear mapping is:
κ(x i ,x j )=<θ(x i ),θ(x j )>
wherein,,<θ(x i ),θ(x j )>represents the gradient direction square characteristic (x i ,x j ) Inner product calculation of nonlinear mapping, κ (x i ,x j ) For the gradient direction square feature (x i ,x j ) Is a non-linear mapping function of (2);
the constraint solution is as follows:
Figure BDA0002049758810000101
Figure BDA0002049758810000102
wherein alpha is i ≥0,i=1,2,...m
Wherein m is the gradient direction straightNumber of square features, alpha i ,α j Lagrangian number multiplied by a factor, y, solved for the constraint i ,y j Labels for the positive and negative samples, s.t, are constraints.
In the preferred embodiment of the present invention, the loss function is a least square method, and the loss function value is L (e):
Figure BDA0002049758810000103
wherein e is the error value between the training value of the black eye judgment model and the label set, k is the total number of the positive sample set and the negative sample set, y i For the tag set, y' i For the training value, the threshold is typically set to 0.01.
And step three, receiving a test set of a user, mapping data in the test set to a high-dimensional space based on a nonlinear mapping method, performing direct gradient square operation on the mapped test set, inputting the direct gradient square operation to the black eye judgment model to judge whether the black eye exists or not, and outputting a result.
The data mapping in the preferred embodiment of the invention adopts the nonlinear mapping method of the support vector machine.
Alternatively, in other embodiments, the black eye intelligent judging program may be further divided into one or more modules, where one or more modules are stored in the memory 11 and executed by one or more processors (the processor 12 in this embodiment) to complete the present invention, and the modules refer to a series of instruction segments of a computer program capable of performing a specific function, for describing the execution of the black eye intelligent judging program in the black eye intelligent judging device.
For example, referring to fig. 3, a schematic program module of a black eye intelligent judging program in an embodiment of the black eye intelligent judging apparatus according to the present invention is shown, where the black eye intelligent judging program may be divided into a data receiving module 10, a support vector machine training module 20, and a black eye judging module 30 by way of example:
the data receiving module 10 is configured to: the face image collection is received, the face image collection is divided into a positive sample collection and a negative sample collection through a label collection, and after preprocessing operations comprising graying, binarization and noise reduction are carried out on the positive sample collection and the negative sample collection, the positive sample collection, the negative sample collection and the label collection after preprocessing are input to a data processing layer.
The support vector machine training module 20 is configured to: receiving a positive sample set, a negative sample set and the tag set which are subjected to pretreatment, inputting the tag set into a black eye judgment model, carrying out direct gradient square operation on data of the positive sample set and the negative sample set, and then inputting the data into the black eye judgment model, wherein the black eye judgment model trains the negative sample set and the positive sample set based on a support vector machine algorithm, and quits training until a loss function value in the support vector machine algorithm is smaller than a threshold value.
The black eye judgment module 30 is configured to: receiving a test set of a user, mapping data in the test set to a high-dimensional space based on a nonlinear mapping method, performing direct gradient square operation on the mapped test set, inputting the direct gradient square operation to the black eye judgment model to judge whether the black eye exists or not, and outputting a result.
The functions or operation steps implemented when the program modules such as the data receiving module 10, the support vector machine training module 20, the black eye judgment module 30 and the like are executed are substantially the same as those of the foregoing embodiments, and will not be described herein.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a black eye intelligent judgment program is stored, where the black eye intelligent judgment program may be executed by one or more processors to implement the following operations:
receiving a face image set, wherein the face image set is divided into a positive sample set and a negative sample set through a label set, preprocessing operation comprising graying, binarizing and noise reduction is carried out on the positive sample set and the negative sample set, and then the positive sample set, the negative sample set and the label set which are preprocessed are input to a data processing layer;
receiving a positive sample set, a negative sample set and the label set which are subjected to pretreatment, inputting the label set into a black eye judgment model, performing direct gradient square operation on data of the positive sample set and the negative sample set, and then inputting the data into the black eye judgment model, wherein the black eye judgment model trains the negative sample set and the positive sample set based on a support vector machine algorithm, and quits training until a loss function value in the support vector machine algorithm is smaller than a threshold value;
receiving a test set of a user, mapping data in the test set to a high-dimensional space based on a nonlinear mapping method, performing direct gradient square operation on the mapped test set, inputting the direct gradient square operation to the black eye judgment model to judge whether the black eye exists or not, and outputting a result.
The specific embodiments of the computer readable storage medium of the present invention are substantially the same as the above-described embodiments of the black eye intelligent judging apparatus and method, and will not be described herein.
It should be noted that, the foregoing reference numerals of the embodiments of the present invention are merely for describing the embodiments, and do not represent the advantages and disadvantages of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, apparatus, article or method that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (6)

1. An intelligent judging method for black eyes is characterized by comprising the following steps:
the data receiving layer receives a face image set, the face image set is divided into a positive sample set and a negative sample set through a label set, preprocessing operations comprising graying, binarizing and noise reduction are carried out on the positive sample set and the negative sample set, and the positive sample set, the negative sample set and the label set which are subjected to preprocessing are input to the data processing layer;
the data processing layer receives the positive sample set, the negative sample set and the label set which are subjected to pretreatment, inputs the label set into a black eye judgment model, carries out direct gradient square operation on the data of the positive sample set and the negative sample set, and then inputs the data into the black eye judgment model, and the black eye judgment model trains the negative sample set and the positive sample set based on a support vector machine algorithm until a loss function value in the support vector machine algorithm is smaller than a threshold value, and quits training;
receiving a test set of a user, mapping data in the test set to a high-dimensional space based on a nonlinear mapping method, performing direct-square operation on the mapped test set in a direction gradient, inputting the direct-square operation to the black eye judgment model to judge whether a black eye exists or not, and outputting a result;
the method for determining the black eye comprises the steps of performing direct-square operation on data of the positive sample set and the negative sample set, and inputting the data into a black eye judgment model, wherein the method comprises the following steps: calculating gradient amplitude values and gradient direction values of all pixel points (x, y) of data in the face image set, and forming a gradient matrix by taking the gradient amplitude values as first components and the gradient direction values as second components; dividing the data in the gradient matrix into a plurality of small blocks, adding the gradient amplitude value and the gradient direction value of each small block, connecting the added values in series to form a gradient direction straight feature, and inputting the gradient direction straight feature into a black eye judgment model;
the support vector machine algorithm comprises nonlinear mapping and constraint solving;
the nonlinear mapping is:
κ(x i ,x j )=<θ(x i ),θ(x j )>
wherein,,<θ(x i ),θ(x j )>represents the gradient direction square characteristic (x i ,x j ) Inner product calculation of nonlinear mapping, κ (x i ,x j ) For the gradient direction square feature (x i ,x j ) Is a non-linear mapping function of (2);
the constraint solution is as follows:
Figure QLYQS_1
Figure QLYQS_2
wherein alpha is i ≥0,i=1,2,…m
Wherein m is the number of the gradient direction rectangularity features, alpha i ,α j Lagrangian number multiplied by a factor, y, solved for the constraint i ,y j Labels that are positive and negative samples, s.t is a constraint.
2. The method of claim 1, wherein the data in the positive sample set is a face including black eye and the data in the negative sample set is a face not including black eye.
3. The method for intelligently judging the black eye according to claim 1 or 2, wherein the noise reduction processing adopts an adaptive image noise reduction filtering method:
g(x,y)=η(x,y)+f(x,y)
Figure QLYQS_3
wherein (x, y) represents coordinates of pixel points of an image, f (x, y) is output data obtained by performing noise reduction processing on the positive sample set and the negative sample set based on the adaptive image noise reduction filtering method, eta (x, y) is noise, g (x, y) is the positive sample set and the negative sample set,
Figure QLYQS_4
for the total noise variance of the positive and negative sample sets, +.>
Figure QLYQS_5
Is the pixel gray average value of the (x, y), is->
Figure QLYQS_6
For the pixel gray variance of (x, y), L represents the current pixel point coordinates.
4. The device is characterized by comprising a memory and a processor, wherein the memory stores a black eye intelligent judging program which can run on the processor, and the black eye intelligent judging program realizes the following steps when being executed by the processor:
the data receiving layer receives a face image set, the face image set is divided into a positive sample set and a negative sample set through a label set, preprocessing operations comprising graying, binarizing and noise reduction are carried out on the positive sample set and the negative sample set, and the positive sample set, the negative sample set and the label set which are subjected to preprocessing are input to the data processing layer;
the data processing layer receives the positive sample set, the negative sample set and the label set which are subjected to pretreatment, inputs the label set into a black eye judgment model, carries out direct gradient square operation on the data of the positive sample set and the negative sample set, and then inputs the data into the black eye judgment model, and the black eye judgment model trains the negative sample set and the positive sample set based on a support vector machine algorithm until a loss function value in the support vector machine algorithm is smaller than a threshold value, and quits training;
receiving a test set of a user, mapping data in the test set to a high-dimensional space based on a nonlinear mapping method, performing direct-square operation on the mapped test set in a direction gradient, inputting the direct-square operation to the black eye judgment model to judge whether a black eye exists or not, and outputting a result;
the method for determining the black eye comprises the steps of performing direct-square operation on data of the positive sample set and the negative sample set, and inputting the data into a black eye judgment model, wherein the method comprises the following steps: calculating gradient amplitude values and gradient direction values of all pixel points (x, y) of data in the face image set, and forming a gradient matrix by taking the gradient amplitude values as first components and the gradient direction values as second components; dividing the data in the gradient matrix into a plurality of small blocks, adding the gradient amplitude value and the gradient direction value of each small block, connecting the added values in series to form a gradient direction straight feature, and inputting the gradient direction straight feature into a black eye judgment model;
the support vector machine algorithm comprises nonlinear mapping and constraint solving;
the nonlinear mapping is:
κ(x i ,x j )=<θ(x i ),θ(x j )>
wherein,,<θ(x i ),θ(x j )>represents the gradient direction square characteristic (x i ,x j ) Inner product calculation of nonlinear mapping, κ (x i ,x j ) For the gradient direction square feature (x i ,x j ) Is a non-linear mapping function of (2);
the constraint solution is as follows:
Figure QLYQS_7
Figure QLYQS_8
wherein alpha is i ≥0,i=1,2,…m
Wherein m is the number of the gradient direction rectangularity features, alpha i ,α j Lagrangian number multiplied by a factor, y, solved for the constraint i ,y j Labels that are positive and negative samples, s.t is a constraint.
5. The intelligent judging apparatus of black eye according to claim 4, wherein the noise reduction process employs an adaptive image noise reduction filtering method:
g(x,y)=η(x,y)+f(x,y)
Figure QLYQS_9
wherein (x, y) represents coordinates of pixel points of an image, f (x, y) is output data obtained by performing noise reduction processing on the positive sample set and the negative sample set based on the adaptive image noise reduction filtering method, eta (x, y) is noise, g (x, y) is the positive sample set and the negative sample set,
Figure QLYQS_10
for the total noise variance of the positive and negative sample sets, +.>
Figure QLYQS_11
Is the pixel gray average value of the (x, y), is->
Figure QLYQS_12
For the pixel gray variance of (x, y), L represents the current pixel point coordinates.
6. A computer-readable storage medium, wherein the computer-readable storage medium has stored thereon a black eye intelligent judgment program executable by one or more processors to implement the steps of the black eye intelligent judgment method of any one of claims 1 to 3.
CN201910370457.4A 2019-05-06 2019-05-06 Intelligent judging method and device for black eye and computer readable storage medium Active CN110211094B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910370457.4A CN110211094B (en) 2019-05-06 2019-05-06 Intelligent judging method and device for black eye and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910370457.4A CN110211094B (en) 2019-05-06 2019-05-06 Intelligent judging method and device for black eye and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110211094A CN110211094A (en) 2019-09-06
CN110211094B true CN110211094B (en) 2023-05-26

Family

ID=67786871

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910370457.4A Active CN110211094B (en) 2019-05-06 2019-05-06 Intelligent judging method and device for black eye and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110211094B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111695463B (en) * 2020-05-29 2022-07-26 深圳数联天下智能科技有限公司 Training method of face impurity detection model and face impurity detection method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101609502A (en) * 2009-07-24 2009-12-23 西安电子科技大学 Method for detecting human face based on sequence simplifying support vector
CN107958245A (en) * 2018-01-12 2018-04-24 上海正鹏信息科技有限公司 A kind of gender classification method and device based on face characteristic
WO2018200840A1 (en) * 2017-04-27 2018-11-01 Retinopathy Answer Limited System and method for automated funduscopic image analysis
CN108985159A (en) * 2018-06-08 2018-12-11 平安科技(深圳)有限公司 Human-eye model training method, eye recognition method, apparatus, equipment and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101609502A (en) * 2009-07-24 2009-12-23 西安电子科技大学 Method for detecting human face based on sequence simplifying support vector
WO2018200840A1 (en) * 2017-04-27 2018-11-01 Retinopathy Answer Limited System and method for automated funduscopic image analysis
CN107958245A (en) * 2018-01-12 2018-04-24 上海正鹏信息科技有限公司 A kind of gender classification method and device based on face characteristic
CN108985159A (en) * 2018-06-08 2018-12-11 平安科技(深圳)有限公司 Human-eye model training method, eye recognition method, apparatus, equipment and medium

Also Published As

Publication number Publication date
CN110211094A (en) 2019-09-06

Similar Documents

Publication Publication Date Title
CN110853047B (en) Intelligent image segmentation and classification method, device and computer readable storage medium
CN109635627A (en) Pictorial information extracting method, device, computer equipment and storage medium
CN113283446B (en) Method and device for identifying object in image, electronic equipment and storage medium
CN111414916B (en) Method and device for extracting and generating text content in image and readable storage medium
CN110163204A (en) Businessman&#39;s monitoring and managing method, device and storage medium based on image recognition
CN112580684B (en) Target detection method, device and storage medium based on semi-supervised learning
CN111639704A (en) Target identification method, device and computer readable storage medium
CN110335206B (en) Intelligent filter method, device and computer readable storage medium
CN110399812B (en) Intelligent face feature extraction method and device and computer readable storage medium
CN110135421A (en) Licence plate recognition method, device, computer equipment and computer readable storage medium
CN110222571B (en) Intelligent judgment method and device for black eye and computer readable storage medium
CN112991217A (en) Medical image acquisition method, device and equipment
CN111476760B (en) Medical image generation method and device, electronic equipment and medium
CN110705547B (en) Method and device for recognizing text in image and computer readable storage medium
CN113792672B (en) Public place health code acquisition method, device, equipment and medium
CN110211094B (en) Intelligent judging method and device for black eye and computer readable storage medium
CN111179222B (en) Intelligent cerebral hemorrhage point detection method and device and computer readable storage medium
CN112633200A (en) Human face image comparison method, device, equipment and medium based on artificial intelligence
CN112329666A (en) Face recognition method and device, electronic equipment and storage medium
CN106650758A (en) Identity card information decoding method based on image segmenting technology
CN110929561B (en) Intelligent form text filtering method and device and computer readable storage medium
CN113408517B (en) Image display method and device and electronic equipment
CN112507903B (en) False face detection method, false face detection device, electronic equipment and computer readable storage medium
CN115439850A (en) Image-text character recognition method, device, equipment and storage medium based on examination sheet
CN111582143A (en) Student classroom attendance method and device based on image recognition and 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
GR01 Patent grant
GR01 Patent grant