CN112200774A - Image recognition apparatus - Google Patents

Image recognition apparatus Download PDF

Info

Publication number
CN112200774A
CN112200774A CN202011001197.2A CN202011001197A CN112200774A CN 112200774 A CN112200774 A CN 112200774A CN 202011001197 A CN202011001197 A CN 202011001197A CN 112200774 A CN112200774 A CN 112200774A
Authority
CN
China
Prior art keywords
vaccinia
target
detection
image
pox
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
CN202011001197.2A
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.)
Shenzhen Shuliantianxia Intelligent Technology Co Ltd
Original Assignee
Shenzhen Shuliantianxia Intelligent Technology 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 Shenzhen Shuliantianxia Intelligent Technology Co Ltd filed Critical Shenzhen Shuliantianxia Intelligent Technology Co Ltd
Priority to CN202011001197.2A priority Critical patent/CN112200774A/en
Publication of CN112200774A publication Critical patent/CN112200774A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • 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/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • 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
    • G06T2207/30088Skin; Dermal
    • 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

Abstract

The embodiment of the invention discloses image recognition equipment, which can extract all the optimal boundary frames capable of representing the pox areas from a pox detection set in a mode of extracting the optimal boundary frames of the pox areas from the pox detection set and adding the optimal boundary frames to a target boundary frame set, so that the accuracy of the pox detection is improved, and further, the accuracy of the selection of the target boundary frame is improved and the accuracy of the pox detection is improved by updating the detection values of the boundary frames in an overlapping frame set and determining the target boundary frame according to the updated overlapping frame set.

Description

Image recognition apparatus
Technical Field
The invention relates to the technical field of image processing, in particular to image recognition equipment.
Background
The accurate judgment of the severity of skin diseases is important in the medical field, wherein acne is the most common skin disease, the incidence rate is the highest in adolescence, about 80% of adolescents suffer from acne, the symptoms last to 3% of men and 12% of women after adults, and the acne may leave scars and pigmentation problems and often causes lower emotion and depression, so that acne patients need to be treated urgently, and for the situation, many users hope to analyze the specific situation of facial acne by using an application program, however, the existing method for detecting the acne is easy to miss detection, and the accuracy of detecting the acne is low.
Disclosure of Invention
The invention mainly aims to provide image recognition equipment which can effectively avoid missing detection and improve the accuracy of pox detection.
To achieve the above object, a first aspect of the present invention provides an image recognition apparatus comprising a memory and one or more processors for executing one or more computer programs stored in the memory; the one or more computer programs are stored in the memory; the one or more processors, when executing the one or more computer programs, perform the steps of:
acquiring a face image of the pox to be detected;
inputting the face image into a vaccinia detection model, and acquiring a vaccinia detection set of the face image, wherein the vaccinia detection set comprises detected bounding boxes and detection values of the bounding boxes, and the detection values are used for indicating the possibility of detecting vaccinia in the bounding boxes;
determining an overlapping frame set in the vaccinia detection set, updating detection values of bounding boxes in the overlapping frame set, determining a target bounding box according to the updated overlapping frame set, extracting the target bounding box from the vaccinia detection set, and adding the target bounding box to the target bounding box set, wherein the overlapping frame set comprises at least two bounding boxes for identifying the same vaccinia region, and the target bounding box is an optimal bounding box capable of representing the vaccinia region;
and determining a pox detection result of the face image according to the target bounding box set.
The embodiment of the invention has the following beneficial effects:
the invention provides image recognition equipment, which is characterized in that after a face image to be detected for pox is input into a pox detection model, a pox detection set of the face image is obtained, an overlapping frame set in the pox detection set is determined, detection values of boundary frames in the overlapping frame set are updated, a target boundary frame is determined according to the updated overlapping frame set, the target boundary frame is extracted from the pox detection set, the target boundary frame is added to the target boundary frame set, and the pox detection result of the face image is determined according to the target boundary frame set. The overlap frame set comprises at least two boundary frames for identifying the same vaccinia region, so that the optimal boundary frame capable of representing the vaccinia region can be determined from the at least two boundary frames, all the optimal boundary frames capable of representing the vaccinia region can be extracted from the vaccinia detection set in a mode of extracting the optimal boundary frames of the vaccinia region from the vaccinia detection set and adding the optimal boundary frames to the target boundary frame set, accuracy of vaccinia detection is improved, furthermore, detection values of the boundary frames in the overlap frame set are updated, and the target boundary frame is determined according to the updated overlap frame set, so that accuracy of selection of the target boundary frame can be improved, and accuracy of vaccinia detection is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Wherein:
fig. 1 is a hardware configuration diagram of an image recognition apparatus according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a pox detection method in an embodiment of the invention;
FIG. 3 is a flow chart illustrating a refinement step of step 203 in the embodiment of FIG. 2;
FIG. 4 is a schematic structural diagram of a vaccinia detection model in an embodiment of the invention;
FIG. 5 is a schematic flow chart of a training method of the vaccinia detection model in the embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a hardware structure diagram of an image recognition apparatus according to an embodiment of the present invention, wherein the image recognition apparatus 100 may be any type of electronic apparatus with computing capability, for example: smart phones, computers, palmtop computers, tablet computers, and the like.
Specifically, as shown in fig. 1, the image recognition device 100 includes one or more processors 102 and memory 104. One processor 102 is illustrated in fig. 1. The processor 102 and the memory 104 may be connected by a bus or other means, such as by a bus in FIG. 1.
The memory 104, as a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as programs, instructions, and modules corresponding to the pox detection model, wherein the programs, instructions, and modules corresponding to the pox detection model may include programs, instructions, and modules corresponding to the pox detection method described below, and programs, instructions, and modules corresponding to the pox detection model training method described below. The processor 102 executes various functional applications and data processing of the electronic device by executing non-volatile software programs, instructions, and modules stored in the memory 104.
The memory 104 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the image recognition apparatus, and the like. Further, the memory 104 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 104 may optionally include memory located remotely from processor 102, which may be connected to the image recognition device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The image recognition device in the embodiment of the invention is used for recognizing the face image to determine the pox in the face image and training the pox detection model to obtain the pox detection model for detecting the pox. The memory 104 is used for storing a computer implemented program of the pox detection method, and the processor 102 is used for reading and executing computer readable instructions. Specifically, the processor 102 may be configured to invoke a computer-implemented program of the vaccinia detection method stored in the memory 104 and execute instructions contained in the computer-implemented program to perform method steps related to the vaccinia detection method. The method steps of the pox detection method performed by the processor 102 can be described with reference to fig. 2-4, which are described below. Optionally, the memory 104 is further configured to store a computer program of a training method of a vaccinia detection model, and the processor 102 may be configured to invoke a computer-implemented program of the training method of the vaccinia detection model stored in the memory 104 and execute instructions contained in the computer-implemented program to perform method steps related to the training method of the vaccinia detection model. The method steps of the training method for the pox detection model executed by the processor 102 can be referred to the following description of fig. 5.
Please refer to fig. 2, which is a schematic flow chart of a pox detecting method according to an embodiment of the present invention, the method includes:
step 201, acquiring a face image of a pox to be detected;
step 202, inputting the face image into a pox detection model, and acquiring a pox detection set of the face image, wherein the pox detection set comprises a detected boundary box and a detection value of the boundary box;
in an embodiment of the present invention, the pox detecting method is implemented by the image recognition device 100, and specifically, by the processor 102.
The face image of the pox to be detected can be acquired by shooting in a mode of starting a camera, or can be a face image uploaded by a user from an album, or can be a received face image sent by other equipment, wherein the face image can be an image containing the whole face of the user, or can be an image of a partial area of the face, for example, the face image can be a pox image of the forehead, a pox image of the cheek, a pox image of the chin, and the like.
The face image is input into a vaccinia detection module, which may be a yolov 3-frame-based model having three branches, each branch outputting a feature map, and a vaccinia detection set of the face image may be obtained according to the output feature maps, where the vaccinia detection set includes a detected bounding box and a detection value of the bounding box, where the detection value is used to indicate a possibility of detecting vaccinia within the bounding box. For example, if a bounding box A detects a value of 0.35, it indicates that the probability of detecting vaccinia within the bounding box is 0.35.
The bounding box is determined in the face image, and the area enclosed by the bounding box is an area where pox possibly exists.
Step 203, determining an overlapping frame set in the vaccinia detection set, updating detection values of bounding boxes in the overlapping frame set, determining a target bounding box according to the updated overlapping frame set, extracting the target bounding box from the vaccinia detection set, and adding the target bounding box to the target bounding box set;
and step 204, determining a pox detection result of the face image according to the target bounding box set.
In the embodiment of the present invention, the bounding boxes are all bounding boxes that are determined in the face image and may have pox, when the pox detection model is used for performing the pox detection, multiple bounding boxes may exist in the same pox region, and there may be a situation that the multiple bounding boxes overlap, where the overlap refers to a partial or complete overlap of a region surrounded by one bounding box and a region surrounded by another bounding box, the size of the overlap may be described by using an overlap ratio, and the overlap ratio may be specifically the size of an intersection of the regions surrounded by the two bounding boxes occupying the whole region of one of the bounding boxes, and in order to remove redundancy of the bounding boxes, an optimal bounding box that can represent the pox region is determined for each pox region, and the optimal bounding box may be referred to as a target bounding box, and for each pox region, a set of overlapping boxes of the pox area can be obtained, the set of overlapping boxes comprises at least two bounding boxes identifying the same pox area, and the target bounding box needs to determine a target bounding box based on the set of overlapping boxes.
In the embodiment of the invention, considering that a vaccinia detection set obtained based on a vaccinia detection model may have a plurality of bounding boxes for the same vaccinia region, and the plurality of bounding boxes have redundancy, in order to better determine a vaccinia detection result, an optimal bounding box capable of representing the vaccinia region needs to be selected from the plurality of bounding boxes, however, when a face with long vaccinia is considered, the situation that the vaccinia is densely present is often easy to occur, so that the situation that two bounding boxes of two adjacent vaccinia regions overlap occurs, if the face is considered as the same vaccinia region and a bounding box identifying another vaccinia region is selected, the situation that the bounding box is selected incorrectly occurs, which results in missing detection of the vaccinia, further results in low accuracy, and in order to select a bounding box more conforming to the actual vaccinia situation, and avoiding missing detection of the smallpox caused by wrong selection of the boundary frame, determining an overlapping frame set in the smallpox detection set, updating the detection value of the boundary frame in the overlapping frame set, and determining a target boundary frame by using the updated overlapping frame set so as to extract the target boundary frame from the smallpox detection set, wherein the problem of wrong selection of the boundary frame can be effectively avoided by updating the detection value of the overlapping frame set and determining the target boundary frame by using the updated overlapping frame set, the accuracy of the target boundary frame is effectively improved, the target boundary frame is added into the target boundary frame set, and the smallpox detection result of the face image is determined according to the target boundary frame set, so that the accuracy of the smallpox detection result can be effectively improved.
The bounding box included in the target bounding box set can be used as the detected bounding box for determining existence of the vaccinia, namely the vaccinia detection result.
In the embodiment of the present invention, since the overlap frame set includes at least two boundary frames identifying the same vaccinia region, an optimal boundary frame capable of representing the vaccinia region may be determined from the at least two boundary frames, and all optimal boundary frames capable of representing the vaccinia region may be extracted from the vaccinia detection set in a manner of extracting the optimal boundary frame of the vaccinia region from the vaccinia detection set and adding the optimal boundary frame to the target boundary frame set, so as to improve accuracy of detecting vaccinia.
For better understanding of the technical solution in the embodiment of the present invention, please refer to fig. 3, which is a schematic flow chart of the step 203 in the embodiment of fig. 2 of the present invention, including:
step 301, calculating the overlapping proportion of a first bounding box and other bounding boxes in the vaccinia detection set, and determining the overlapping box set based on the overlapping proportion;
step 302, according to the overlapping proportion of the other target boundary frames and the first boundary frame, updating the detection values of the other target boundary frames in the overlapping frame set to obtain an updated overlapping frame set;
step 303, extracting a boundary box with the maximum detection value in the updated overlapped box set from the vaccinia detection set as a target boundary box, and adding the target boundary box to the target boundary box set;
and step 304, returning to execute the step of calculating the overlapping proportion of the first bounding box and other bounding boxes in the vaccinia detection set, and determining the overlapping box set based on the overlapping proportion until the number of other bounding boxes of the target in the overlapping box set is zero.
In the embodiment of the invention, i is set as the number of times of extracting the target bounding box, the initial value of i is 0, and i is a positive integer. It can be understood that the 0 th pox detection set is an initial pox detection set obtained after the face image is input into the pox detection model, and the 1 st pox detection set is a set obtained after a target boundary box is extracted from the 0 th pox detection set.
Taking the ith pox detection set as an example, a first bounding box and other bounding boxes in the ith pox detection set are determined, wherein the first bounding box is the bounding box with the largest detection value in the ith pox detection set, and the other bounding boxes are any other bounding boxes except the first bounding box in the ith pox detection set.
Specifically, the overlap ratio between the first bounding box and the other bounding boxes may be calculated by first determining the size of an overlap region where the first bounding box and the other bounding boxes overlap, and calculating the ratio of the overlap region to the size of the region where the first bounding box is located, where the ratio is the overlap ratio between the first bounding box and the other bounding boxes. For example, if the overlapping area size of the first bounding box and the other bounding box a is a1, and the area size of the first bounding box is B, a1/B is obtained, the value is used as the overlapping proportion of the first bounding box and the other bounding box a, when the a1/B is 0, it indicates that the first bounding box is not overlapped with the other bounding box a, when the a1/B is 1, it indicates that the first bounding box is completely overlapped with the other bounding box, and when the a1/B is any value between 0 and 1, it indicates that the first bounding box is partially overlapped with the other bounding box.
The overlapping proportion of the first bounding box and all other bounding boxes can be obtained through the method, and the overlapping box set is determined based on the overlapping proportion, wherein the overlapping box set comprises the first bounding box and other target bounding boxes of which the overlapping proportion with the first bounding box is greater than or equal to a first preset proportion value. For example, if there are 100 bounding boxes in the vaccinia detection set, the bounding box with the largest detection value is the first bounding box, and the remaining 99 bounding boxes are other bounding boxes, and if there are 5 bounding boxes A, B, C, D, E in the remaining 99 bounding boxes whose overlap ratio with the first bounding box is greater than or equal to the first preset ratio value, the resulting overlap box set includes the first bounding box and the bounding box A, B, C, D, E.
It is to be understood that the overlap box set includes at least two bounding boxes identifying the same vaccinia region, and the bounding boxes of the same vaccinia region are usually overlapped and the overlap ratio is non-zero, in the embodiment of the present invention, it is considered that the larger the detection value is, the higher the possibility of existence of vaccinia is, and therefore, the bounding box having the largest detection value in the vaccinia detection set is determined to be the first bounding box, so that the other bounding boxes of the target identifying the same vaccinia region as the first bounding box can be determined based on the overlap ratio, and it is considered that the larger the overlap ratio is, the higher the probability of representing the same vaccinia region as the first bounding box is, and therefore, the first preset ratio value is set so that the other bounding boxes of the target identifying the same vaccinia region as the first bounding box can be determined.
After the overlap frame set is obtained, the detection values of the other target boundary frames in the overlap frame set are updated according to the overlap ratio of the other target boundary frames to the first boundary frame, and the updating mode is as follows:
when the overlapping proportion of the other target boundary frames and the first boundary frame is greater than or equal to a first preset proportion value and smaller than a second preset proportion value, taking the sum of the logarithm value of the predicted value of the other target boundary frames and a preset standard value as the updated predicted value of the other target boundary frames;
and when the overlapping proportion of the other target boundary frames and the first boundary frame is greater than or equal to a second preset proportion value, calculating the absolute value of the difference value between the overlapping proportion of the other target boundary frames and the first boundary frame and a preset standard value, and taking the product of the absolute value and the predicted value of the other target boundary frames as the updated predicted value of the other target boundary frames.
In the embodiment of the present invention, the above manner can effectively implement the update of the detection values of other target bounding boxes, and in order to better understand the above updating method, the following formula can be referred to, which is a feasible formula for updating the detection values of other bounding boxes:
Figure BDA0002694377560000081
where bi represents the other bounding box of the target, MiDenotes a first bounding box, SiDetection values, S, representing other bounding boxes bi of the objecti+1Indicating the updated detection value of the other detection frame bi of the target, IoU (b)i,Mi) The overlap ratio of the first bounding box and other bounding boxes of the target is represented, 0.4 is a first preset ratio value, 0.75 is a second preset ratio value, and 1 is a preset standard value.
In addition, the probability that the other target bounding boxes in the overlapping box set identify the same vaccinia region as the first bounding box is higher when the overlapping proportion of the other target bounding boxes with the first bounding box is higher, and in this case, the target bounding box may be the bounding box of another vaccinia region adjacent to the vaccinia region.
After the updating of the detection values of all other target boundary frames in the overlapped frame set is completed, the updated overlapped frame set can be obtained, the boundary frame with the largest detection value in the overlapped frame set can be determined as the target boundary frame, and the target boundary frame is extracted from the pox detection set and added into the target boundary frame set. And taking the extracted vaccinia detection set as the i +1 th vaccinia detection set, and making i equal to i +1, and returning to execute the steps until the number of other target boundary frames in the determined overlapping frame set is zero.
It is understood that, the above-mentioned updating of the detection values is to update the detection values of the bounding boxes in the overlapped box set, and not to update the detection values of the bounding boxes in the pox detection set, the detection values of the bounding boxes in the pox detection set are the detection values of the bounding boxes in the initial pox detection set all the time, and the i +1 th pox detection set is different from the i th pox detection set in that one target bounding box is reduced, the other bounding boxes are still remained, and the detection values are not changed.
It is understood that, if the number of other bounding boxes of the target in the above-mentioned overlapping box set is zero, it means that only the first bounding box is included in the overlapping box set, and there is no other bounding box in the vaccinia detection set whose overlapping proportion with the first bounding box is greater than or equal to the first preset proportion value, at this time, considering that the first bounding box is a bounding box with a large probability of being scattered, it is not necessary to determine the target bounding box by using the overlapping box set, and further, it may mean that the extraction of the target bounding box has ended.
In the embodiment of the invention, the detection values of other boundary frames of the target in the overlapped frame set can be updated through the method, and then the target boundary frame is selected, so that the situation of missing detection of the pox caused by mistakenly selecting the target boundary frame is avoided, and the pox detection result can be determined through the method of selecting the target boundary frame, so that the accuracy of the pox detection is improved.
Further, the vaccinia detection model may include yolov3 model and three spatial pyramid pooling layers respectively connected to the ends of the three output branches of yolov3 model. The yolov3 model is the third version of the yolo system target detection algorithm, is suitable for detection of small targets, is particularly suitable for detection of small targets such as pox, and is high in precision. In the yolov3 model, there are three output branches, each of which outputs a feature map, and the feature maps output by different output branches have different sizes, in the embodiment of the present invention, the Spatial Pyramid Pooling (SPP) layer is respectively connected to the ends of the three output branches of the yolov3 model, so that the SPP layer can be used to fuse feature information of different receptive fields, thereby improving the detection capability for pox.
In a feasible implementation manner, the yolov3 model may use a DBM module to replace an original DBL module, where the DBL module is Darknetconv2d _ BN _ leak in the code, is a basic component of the yolov3 model, that is, a convolutional layer + BN layer + leak relu, where leak relu represents an activation function, and the DBM module is different from the DBL module in the activation function used, and the activation function used in the DBM module is a hash activation function, and the use of the hash activation function can effectively improve the detection accuracy compared with the leak relu activation function.
For better understanding of the technical solution in the embodiment of the present invention, please refer to fig. 4, which is a schematic structural diagram of a possible implementation manner of the vaccinia detection model in the embodiment of the present invention, wherein the face image represents a face image of pox to be detected, the SPP represents an SPP layer disposed at the end of three output branches of the yolov3 model, the structure between the SPP layer and the face image represents the yolov3 model, and y1, y2, and y3 represent feature maps of final output.
Wherein DBM is the DBM module, Up _ S represents an upsampling module, Conv represents a convolutional layer, and Res _1, Res _2, Res _4, and Res _8 represent feature extraction modules.
In a possible implementation manner, the step 202 may specifically be: and inputting the face image into a pox detection model, obtaining a target characteristic diagram output by the pox detection model, and obtaining a pox detection set of the face image according to the target characteristic diagram and a preset anchor point frame.
The vaccinia detection model is obtained by training a vaccinia sample data set, wherein the vaccinia sample data set comprises vaccinia sample images and actual bounding boxes which are marked on the vaccinia sample images and represent positions of vaccinia. The anchor point frame is obtained based on the vaccinia sample data set, and specifically may be obtained according to a preset multiplier value, a first maximum value and a first minimum value of an actual bounding box length determined based on an actual bounding box in the vaccinia sample data set, and a second maximum value and a second minimum value of a width. It should be noted that the anchor point frame used for detecting the pox by using the pox detection model is the same anchor point frame as the anchor point frame used for training the pox detection model. It should be noted that the specific method for training the pox detection model will be described in detail in the following embodiments, and reference may be made to the following embodiments, which are not described herein again.
In the embodiment of the invention, when the pox detection model is used for detecting the pox, the same anchor point frame is used in the training process of the pox detection model to determine the pox detection set, the same anchor point frame can enhance the accuracy of the pox detection, and the error problem caused by the use of different anchor point frames is avoided.
It can be understood that the above describes a method for detecting pox by using a pox detection model, and a method for training the pox detection model used in the above method is described below, please refer to fig. 5, which is a schematic flow chart of the training method for the pox detection model in the embodiment of the present invention, and includes:
step 501, acquiring a pox sample data set, wherein the pox sample data set comprises a pox sample image and an actual bounding box which is marked on the pox sample image and represents the position of a pox;
step 502, inputting the vaccinia sample image into a vaccinia detection model, and obtaining a prediction set of the vaccinia sample image, wherein the prediction set comprises a prediction boundary box and a prediction value of the prediction boundary box, and the prediction value is used for indicating the possibility of existence of vaccinia in the prediction boundary box;
step 503, determining whether the pox detection model converges according to the prediction set and the actual bounding box of the pox sample image;
step 503, if convergence occurs, determining the pox detection model during convergence as the trained pox detection model;
and step 504, if the images do not converge, returning to the step of inputting the vaccinia sample images into the vaccinia detection model.
In the implementation of the invention, during convergence, the determined trained pox detection model can be applied to the pox detection method so as to improve the accuracy of pox detection.
In a feasible implementation manner, the pox detection module in the embodiment shown in fig. 5 may be a pox detection model described in the related embodiment of the pox detection method, which is not described herein again.
It should be noted that, in the embodiment of the present invention, the pox sample data set includes the pox sample image, and the actual bounding box of the pox sample image, where the actual bounding box may be a manually labeled bounding box, and the accuracy is high, and in addition, the size of the pox sample image is the same, and the pox sample image meets the requirement of training the pox detection model.
In the embodiment of the present invention, before the step 502 is executed, enhancement processing may be further performed on data in the vaccinia sample data set to achieve expansion of the sample data.
Specifically, the enhancement processing includes:
step a 1: acquiring a preset number of target pox sample images with the same image size from the pox sample data set, and splicing the target pox sample images to obtain a spliced image, wherein the target pox sample image is any image in the pox sample data set;
step a 2: performing image size reduction operation on the spliced image until the size of the image of the spliced image is consistent with that of the target pox sample image to obtain a target image;
step a 3: and determining the actual boundary box of the target image according to the actual boundary box of the target vaccinia sample image, and adding the target image serving as the vaccinia sample image to the vaccinia sample data set.
In the embodiment of the present invention, the preset number may be 4, 16, and the like, and since the sizes of the vaccinia sample images in the vaccinia sample data set are all the same, the target vaccinia sample images in the preset number may be randomly acquired, and the target vaccinia sample images in the preset number may be spliced to obtain a spliced image. And further, in order to avoid reducing the number of vaccinia sample images, a target vaccinia sample image may be replicated.
Because the size of the image is increased by the way of stitching the image, so that the size of the image is different from that of the pox sample image in the pox sample data set, the size of the stitched image needs to be reduced until the size of the stitched image is consistent with that of the target pox sample, so as to obtain the target image. Meanwhile, considering that each target pox sample image used for splicing contains an actual bounding box, and after the target pox sample image is subjected to splicing and size reduction operations, the position of the actual bounding box in the target image is different from the position of the actual bounding box in the original target pox sample image, at this time, the actual bounding box of the target image needs to be determined according to the actual bounding box of the target pox sample image, and the target image is taken as the pox sample image and added to the pox sample data set.
In a feasible implementation manner, the actual bounding box of the target image may be obtained as follows, specifically, after the stitched image is obtained by stitching with a preset number of target pox sample images, the position information of the actual bounding box of the target pox sample image in the stitched image may be updated based on the position of the target pox sample image in the stitched image, so that the position information of the actual bounding box in the stitched image that is sufficient for stitching may be determined, and further, after the stitched image is reduced in size to obtain the target image, the position information of the actual bounding box in the stitched image is processed according to the reduced parameters to obtain the position information of the actual bounding box in the target image.
For better understanding, taking an example that a target vaccinia sample image comprises four ABCD images, the target vaccinia sample image may be first stitched into a stitched image according to an order from top to bottom, the top left corner of the stitched image is an a image, the top right corner of the stitched image is a B image, the bottom left corner of the stitched image is a C image, and the bottom right corner of the stitched image is a D image, when the stitched image is in a standard two-dimensional coordinate system, the vertex of the bottom left corner of the C image is an origin of the two-dimensional coordinate system, at this time, the position information of the C image does not need to be updated, the position information of the ABD image needs to be updated, for the a image, the width of an actual bounding box in the a image may be added to the width of the a image to obtain updated position information of the actual bounding box in the a image, for the B image, the length of the actual bounding box in the B image may be added to the length of the a image, the width of the B image to obtain updated position information of, for the D image, the length of the actual bounding box in the D image may be added to the length of the a image to obtain the position information of the actual bounding box in the D image. And if the stitched image is reduced according to the preset size, the size of the actual bounding box in the stitched image in the target image also needs to be reduced correspondingly, and the position information of the actual bounding box in the target image can be effectively determined by reducing the position information of the bounding box.
In the embodiment of the invention, the target images are used for training the pox detection model, so that the detection capability of the trained pox detection model on the dense pox is improved, and the accuracy of the pox detection is improved.
In the implementation of the invention, the size of the anchor point frame can be further set according to the characteristics of the vaccinia label, so that the anchor point frame more conforming to the vaccinia detection scene can be set.
Specifically, before step 502 is executed, the anchor block may be set by the following methods, including:
step b 1: acquiring a first maximum value and a first minimum value of the length of an actual boundary box in the pox sample data set, and a second maximum value and a second minimum value of the width of the actual boundary box;
step b 2: and setting an anchor point frame corresponding to the multiple value according to the first maximum value, the first minimum value, the second maximum value, the second minimum value and the preset multiple value.
In the embodiment of the invention, the length values and the width values of the actual bounding boxes of all the vaccinia sample images in the vaccinia sample data set can be counted to obtain the length value set and the width value set, the first maximum value and the first minimum value of the length are selected from the length value set, and the second maximum value and the second minimum value of the width are selected from the width value set, so that the anchor point box corresponding to the multiple values can be set according to the first maximum value, the first minimum value, the second maximum value, the second minimum value and the preset multiple value.
For example, if the first maximum value is Lmax, the first minimum value is Lmin, the second maximum value is Wmax, the second minimum value is Wmin, and the preset times are 8 times, 16 times, and 32 times, it may be determined that the anchor block includes: (Lmax/8, Wmax/8), (Lmax/16, Wmax/16), (Lmax/32, Wmax/32), (Lmin/8, Wmin/8), (Lmin/16, Wmin/16), (Lmin/32, Wmin/32), (Lmax/16, Wmin/16), and (Lmin/8, Wmax/8).
And the yolov3 model of the vaccinia detection model shown in fig. 4 outputs feature maps of 52 × 52, 26 × 26 and 13 × 13 with different sizes, wherein more vaccinia is concentrated in the feature map of 52 × 52, and the feature map of 13 × 13 represents a high semantic feature, so that the SPP layer in the vaccinia detection model fuses features of different receptive fields, thereby improving the learning of the vaccinia detection model on different features.
It can be understood that, for the feature map output by the vaccinia detection model, the anchor point frame and the feature map can be used to generate the predicted bounding box and the predicted value of the predicted bounding box, so as to obtain the predicted set of vaccinia sample images.
Any pixel point in a feature map output by the vaccinia detection model needs to be mapped into a vaccinia sample image, a prediction boundary frame of the pixel point in the vaccinia sample image and a detection value of the prediction boundary frame are predicted based on the anchor point frame, and three prediction boundary frames can be obtained for each pixel point.
It is understood that in the vaccinia detection method, the anchor box described above may also be used to generate a set of vaccinia detections.
In the embodiment of the invention, feature maps with different sizes can be fused by setting the SPP layer in the pox detection model, so that the learning on different features is enhanced, and the size features of the pox can be reflected by the first maximum value, the second maximum value, the first minimum value and the second minimum value, so that the set anchor point frame is more matched with the size of the pox by setting the anchor point frame based on the first maximum value, the second maximum value, the first minimum value and the second minimum value of the actual boundary frame, so that the accuracy of the pox detection is further improved, and the problem of low accuracy of the pox detection caused by the fact that the set anchor point frame is too large or too small in size is solved. In addition, data enhancement can be performed by splicing, reducing and adjusting the actual bounding box, so that more vaccinia sample images for training can be set.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (8)

1. An image recognition device comprising a memory and one or more processors to execute one or more computer programs stored in the memory; the one or more computer programs are stored in the memory; the one or more processors, when executing the one or more computer programs, perform the steps of:
acquiring a face image of the pox to be detected;
inputting the face image into a vaccinia detection model, and acquiring a vaccinia detection set of the face image, wherein the vaccinia detection set comprises detected bounding boxes and detection values of the bounding boxes, and the detection values are used for indicating the possibility of detecting vaccinia in the bounding boxes;
determining an overlapping frame set in the vaccinia detection set, updating detection values of bounding boxes in the overlapping frame set, determining a target bounding box according to the updated overlapping frame set, extracting the target bounding box from the vaccinia detection set, and adding the target bounding box to the target bounding box set, wherein the overlapping frame set comprises at least two bounding boxes for identifying the same vaccinia region, and the target bounding box is an optimal bounding box capable of representing the vaccinia region;
and determining a pox detection result of the face image according to the target bounding box set.
2. The device according to claim 1, wherein the processor, in performing the steps of determining the set of overlapping frames in the vaccinia detection set, updating the detection values of the bounding boxes in the set of overlapping frames, determining a target bounding box according to the updated set of overlapping frames, extracting the target bounding box from the vaccinia detection set, and adding the target bounding box to the set of target bounding boxes, specifically performs the following steps:
calculating the overlapping proportion of a first bounding box and other bounding boxes in the vaccinia detection set, and determining the overlapping box set based on the overlapping proportion; the first bounding box is the bounding box with the largest detection value in the vaccinia detection set, the other bounding boxes are any other bounding boxes except the first bounding box in the vaccinia detection set, and the overlapping box set comprises the first bounding box and other target bounding boxes with the overlapping proportion of the first bounding box being larger than or equal to a first preset proportion value;
according to the overlapping proportion of the other target boundary frames and the first boundary frame, updating the detection values of the other target boundary frames in the overlapping frame set to obtain an updated overlapping frame set;
extracting a boundary box with the maximum detection value in the updated overlapped box set from the vaccinia detection set as a target boundary box, and adding the target boundary box to the target boundary box set;
and returning to the step of calculating the overlapping proportion of the first bounding box and other bounding boxes in the vaccinia detection set, and determining the overlapping box set based on the overlapping proportion until the number of the target other bounding boxes in the overlapping box set is zero.
3. The apparatus according to claim 2, wherein the processor, during the step of updating the detection values of the other bounding boxes of the target in the set of overlapping boxes according to the overlapping proportion of the other bounding boxes of the target to the first bounding box, specifically performs the following steps:
when the overlapping proportion of the other target boundary frames and the first boundary frame is greater than or equal to the first preset proportion value and smaller than a second preset proportion value, taking the sum of the logarithm value of the predicted value of the other target boundary frames and a preset standard value as the updated predicted value of the other target boundary frames;
when the overlapping proportion of the other target boundary frame and the first boundary frame is larger than or equal to the second preset proportion value, calculating an absolute value of a difference value between the overlapping proportion of the other target boundary frame and the first boundary frame and the preset standard value, and taking the product of the absolute value and the predicted value of the other target boundary frame as the updated predicted value of the other target boundary frame.
4. The apparatus of claim 1, wherein the vaccinia detection model comprises yolov3 model and three spatial pyramid pooling layers connected to the ends of the three output branches of the yolov3 model, respectively.
5. The device according to claim 1, wherein the processor, in performing the step of inputting the face image into a vaccinia detection model and obtaining a vaccinia detection set of the face image, specifically performs the following steps:
inputting the face image into the pox detection model to obtain a target characteristic diagram output by the pox detection model;
and obtaining a vaccinia detection set of the face image according to the target feature map and a preset anchor point frame, wherein the anchor point frame is obtained according to a preset numerical value, a first maximum value and a first minimum value of the length of the actual boundary frame determined based on an actual boundary frame in a vaccinia sample set, and a second maximum value and a second minimum value of the width, the vaccinia sample set is data used for training to obtain the vaccinia detection model, and the vaccinia sample set comprises a vaccinia sample image and the actual boundary frame which is marked on the vaccinia sample image and represents the position of vaccinia.
6. The apparatus of claim 1, wherein the processor is further configured to perform the steps of:
acquiring a vaccinia sample data set, wherein the vaccinia sample data set comprises a vaccinia sample image and an actual bounding box which is marked on the vaccinia sample image and represents the position of vaccinia;
inputting the vaccinia sample image into a vaccinia detection model, and obtaining a prediction set of the vaccinia sample image, wherein the prediction set comprises a prediction boundary box and a prediction value of the prediction boundary box, and the prediction value is used for indicating the possibility of existence of vaccinia in the prediction boundary box;
determining whether the vaccinia detection model converges according to the prediction set and an actual bounding box of the vaccinia sample image;
if so, determining the pox detection model at the convergence as the pox detection model;
if not, returning to the step of inputting the vaccinia sample image into a vaccinia detection model.
7. The apparatus of claim 5, wherein the processor, prior to performing the step of inputting the vaccinia sample image into a vaccinia detection model to obtain the prediction set of vaccinia sample images, is further configured to perform the steps of:
acquiring a preset number of target pox sample images with the same image size from the pox sample data set, and splicing the target pox sample images to obtain a spliced image, wherein the target pox sample image is any image in the pox sample data set;
performing image size reduction operation on the spliced image until the size of the image size of the spliced image is consistent with that of the target pox sample image to obtain a target image;
and determining the actual boundary box of the target image according to the actual boundary box of the target vaccinia sample image, and adding the target image as a vaccinia sample image to the vaccinia sample data set.
8. The apparatus according to claim 6 or 7, wherein said processing is further adapted to perform, before performing said step of inputting said vaccinia sample image into a vaccinia detection model to obtain a prediction set of said vaccinia sample image, the steps of:
acquiring a first maximum value and a first minimum value of the length of an actual boundary box in the vaccinia sample data set, and a second maximum value and a second minimum value of the width of the actual boundary box;
setting an anchor point frame corresponding to the multiple value according to the first maximum value, the first minimum value, the second maximum value, the second minimum value and a preset multiple value;
inputting the vaccinia sample image into a vaccinia detection model, and acquiring a prediction set of the vaccinia sample image, wherein the method comprises the following steps:
inputting the vaccinia sample image into a vaccinia detection model to obtain a characteristic diagram output by the vaccinia detection model;
and obtaining the prediction set of the vaccinia sample image according to the feature map and the anchor point frame.
CN202011001197.2A 2020-09-22 2020-09-22 Image recognition apparatus Pending CN112200774A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011001197.2A CN112200774A (en) 2020-09-22 2020-09-22 Image recognition apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011001197.2A CN112200774A (en) 2020-09-22 2020-09-22 Image recognition apparatus

Publications (1)

Publication Number Publication Date
CN112200774A true CN112200774A (en) 2021-01-08

Family

ID=74015888

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011001197.2A Pending CN112200774A (en) 2020-09-22 2020-09-22 Image recognition apparatus

Country Status (1)

Country Link
CN (1) CN112200774A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112767383A (en) * 2021-01-29 2021-05-07 深圳艾摩米智能科技有限公司 Face pox positioning and recognition method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112767383A (en) * 2021-01-29 2021-05-07 深圳艾摩米智能科技有限公司 Face pox positioning and recognition method
CN112767383B (en) * 2021-01-29 2024-02-27 深圳艾摩米智能科技有限公司 Positioning and identifying method for facial acne

Similar Documents

Publication Publication Date Title
CN110135406B (en) Image recognition method and device, computer equipment and storage medium
CN111814794B (en) Text detection method and device, electronic equipment and storage medium
CN110414507B (en) License plate recognition method and device, computer equipment and storage medium
CN110197146B (en) Face image analysis method based on deep learning, electronic device and storage medium
CN112446302B (en) Human body posture detection method, system, electronic equipment and storage medium
CN110276408B (en) 3D image classification method, device, equipment and storage medium
US20240013572A1 (en) Method for face detection, terminal device and non-transitory computer-readable storage medium
US20230334893A1 (en) Method for optimizing human body posture recognition model, device and computer-readable storage medium
WO2023151237A1 (en) Face pose estimation method and apparatus, electronic device, and storage medium
CN111814905A (en) Target detection method, target detection device, computer equipment and storage medium
CN115631112B (en) Building contour correction method and device based on deep learning
CN111968134A (en) Object segmentation method and device, computer readable storage medium and computer equipment
CN114155365A (en) Model training method, image processing method and related device
CN113192175A (en) Model training method and device, computer equipment and readable storage medium
CN112115860A (en) Face key point positioning method and device, computer equipment and storage medium
CN112541394A (en) Black eye and rhinitis identification method, system and computer medium
CN113642585A (en) Image processing method, apparatus, device, storage medium, and computer program product
CN113298158A (en) Data detection method, device, equipment and storage medium
CN111860582B (en) Image classification model construction method and device, computer equipment and storage medium
CN112200774A (en) Image recognition apparatus
CN112464860A (en) Gesture recognition method and device, computer equipment and storage medium
CN113012030A (en) Image splicing method, device and equipment
CN111666931A (en) Character and image recognition method, device and equipment based on mixed convolution and storage medium
CN112801045B (en) Text region detection method, electronic equipment and computer storage medium
CN113255700B (en) Image feature map processing method and device, storage medium and terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210108

WD01 Invention patent application deemed withdrawn after publication