CN109685069B - Image detection method, device and computer readable storage medium - Google Patents

Image detection method, device and computer readable storage medium Download PDF

Info

Publication number
CN109685069B
CN109685069B CN201811617149.9A CN201811617149A CN109685069B CN 109685069 B CN109685069 B CN 109685069B CN 201811617149 A CN201811617149 A CN 201811617149A CN 109685069 B CN109685069 B CN 109685069B
Authority
CN
China
Prior art keywords
image
proportion
size
preset
detected
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
CN201811617149.9A
Other languages
Chinese (zh)
Other versions
CN109685069A (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.)
Leshan Normal University
Original Assignee
Leshan Normal University
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 Leshan Normal University filed Critical Leshan Normal University
Priority to CN201811617149.9A priority Critical patent/CN109685069B/en
Publication of CN109685069A publication Critical patent/CN109685069A/en
Application granted granted Critical
Publication of CN109685069B publication Critical patent/CN109685069B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting

Landscapes

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

Abstract

The invention discloses an image detection method, which comprises the following steps: based on a first proportion and the geometric center of an image to be detected, cutting the image to be detected to obtain a first image; adjusting the size of the first image based on a preset size to obtain a second image; detecting the second image based on a target deep neural network model to obtain a detection result; and when the object exists in the second image based on the detection result, outputting the category of the object in the image to be detected and the coordinates of the object in the image to be detected based on the detection result. The invention also discloses an image detection device and a computer readable storage medium. The invention realizes the rapid identification of the object at the center of the image by gradually increasing the cutting range from the center of the image from inside to outside.

Description

Image detection method, device and computer readable storage medium
Technical Field
The present invention relates to the field of image detection, and in particular, to an image detection method, an image detection apparatus, and a computer-readable storage medium.
Background
The existing image detection technology is that for all objects in an image, a computer automatically predicts the category of each object and locates the area where the object is located. There are two main categories of similar technologies. The first type is to divide the detection into two stages of positioning and classification, and the main method is R-CNN (Region-Convolutional Neural Networks) and its improved methods such as fast R-CNN and faster R-CNN; and the second type is to complete positioning and classification in one step, predict the position and predict the object class. The main methods are YOLO (You Only need to see Once) and SSD (Single Shot multi box detector).
Since these methods are not specific to the detection of the image center object, the amount of calculation is large, the efficiency is low, and the recognition accuracy is not high when the image center object is detected.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide an image detection method, and aims to solve the technical problems of large calculation amount, low efficiency and low identification precision when an image center object is detected by the existing method.
In order to achieve the above object, the present invention provides an image detection method, including the steps of:
based on a first proportion and the geometric center of an image to be detected, cutting the image to be detected to obtain a first image;
adjusting the size of the first image based on a preset size to obtain a second image;
detecting the second image based on a target deep neural network model to obtain a detection result;
and when the object exists in the second image based on the detection result, outputting the category of the object in the image to be detected and the coordinates of the object in the image to be detected based on the detection result.
Preferably, the step of resizing the first image based on a preset size to obtain a second image comprises:
acquiring the size of the first image, and determining whether the size of the first image is larger than the preset size;
and if the size of the first image is larger than the preset size, adjusting the size of the first image based on the preset size.
Preferably, after the step of detecting the second image based on the target deep neural network model to obtain a detection result, the image detection method further includes:
when it is determined that no object exists in the second image based on the detection result, determining a second proportion based on the first proportion and a preset rule, wherein the second proportion is larger than the first proportion;
and taking the second proportion as the first proportion, and continuously executing the step of cutting the image to be detected based on the first proportion and the geometric center of the image to be detected.
Preferably, the determining the second ratio based on the first ratio and a preset rule includes:
acquiring set detection precision, and determining parameters corresponding to the preset rules based on the detection precision;
a second ratio is determined based on the parameter and the first ratio.
Preferably, when it is determined that there is no object in the second image based on the detection result, the step of determining the second ratio based on the first ratio and a preset rule includes:
determining whether the first ratio is greater than a preset ratio when it is determined that no object is present in the second image based on the detection result;
if the first proportion is smaller than a preset proportion, determining a second proportion based on the first proportion and a preset rule;
and if the first proportion is larger than or equal to a preset proportion, outputting prompt information that no object exists in the image to be detected.
Preferably, before the step of cropping the image to be detected based on the first scale and the geometric center of the image to be detected to obtain the first image, the image detection method further includes:
obtaining a sample corresponding to the image to be detected;
processing the sample based on a preset size to obtain a target sample;
processing the target sample based on a preset rule to obtain a training sample;
performing cross validation training on the deep neural network based on the training sample to obtain a weight file and a value of a hyper-parameter of a target deep neural network model;
determining a target deep neural network model based on the weight file and the values of the hyper-parameters.
Preferably, the processing the sample based on the preset size to obtain the target sample comprises:
acquiring the sample, wherein the sample comprises an annotation image and annotation information;
adjusting the size of the marked image based on a preset size to obtain a target image;
a target sample is determined based on the target image and the annotation information.
In addition, to achieve the above object, the present invention also provides a detection apparatus, comprising: a memory, a processor and an image detection program stored on the memory and executable on the processor, the image detection program when executed by the processor implementing the steps of the image detection method of any of the above.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon an image detection program which, when executed by a processor, realizes the steps of the image detection method described in any one of the above.
Firstly, based on a first proportion and a geometric center of an image to be detected, cutting the image to be detected to obtain a first image, then, based on a preset size, adjusting the size of the first image to obtain a second image, then, based on a target depth neural network model, detecting the second image to obtain a detection result, and finally, when an object exists in the second image which is determined based on the detection result, outputting the category of the object in the image to be detected and the coordinate of the object in the image to be detected based on the detection result; the mode that the cutting range is gradually increased from the center point of the image from inside to outside realizes the quick identification of the object at the center of the image.
Drawings
FIG. 1 is a schematic structural diagram of an image detection apparatus of a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating an image detection method according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows:
based on a first proportion and the geometric center of an image to be detected, cutting the image to be detected to obtain a first image; adjusting the size of the first image based on a preset size to obtain a second image; detecting the second image based on a target deep neural network model to obtain a detection result; and when the object exists in the second image based on the detection result, outputting the category of the object in the image to be detected and the coordinates of the object in the image to be detected based on the detection result.
Because the prior art does not research on the detection of the central object of the image, the invention provides a solution, and the rapid identification of the central object of the image is realized by gradually increasing the cutting range from the central point of the image from inside to outside.
As shown in fig. 1, fig. 1 is a schematic structural diagram of an image detection apparatus of a hardware operating environment according to an embodiment of the present invention.
The image detection device in the embodiment of the present invention may be a PC, or may be a mobile image detection device having a display function, such as a smart phone, a tablet computer, an electronic book reader, an MP3(Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3) player, an MP4(Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4) player, a portable computer, or the like.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU and/or GPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the image detection device may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors.
Those skilled in the art will appreciate that the configuration of the image sensing device shown in fig. 1 does not constitute a limitation of the image sensing device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and an image detection program.
In the image detection apparatus shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call the image detection program stored in the memory 1005 and perform the following operations:
based on a first proportion and the geometric center of an image to be detected, cutting the image to be detected to obtain a first image;
adjusting the size of the first image based on a preset size to obtain a second image;
detecting the second image based on a target deep neural network model to obtain a detection result;
and when the object exists in the second image based on the detection result, outputting the category of the object in the image to be detected and the coordinates of the object in the image to be detected based on the detection result.
Further, the processor 1001 may call the image detection program stored in the memory 1005, and also perform the following operations:
acquiring the size of the first image, and determining whether the size of the first image is larger than the preset size;
if the size of the first image is larger than the preset size, adjusting the size of the first image based on the preset size
Further, the processor 1001 may call the image detection program stored in the memory 1005, and also perform the following operations:
when it is determined that no object exists in the second image based on the detection result, determining a second proportion based on the first proportion and a preset rule, wherein the second proportion is larger than the first proportion;
and taking the second proportion as the first proportion, and continuously executing the step of cutting the image to be detected based on the first proportion and the geometric center of the image to be detected.
Further, the processor 1001 may call the image detection program stored in the memory 1005, and also perform the following operations:
acquiring set detection precision, and determining parameters corresponding to the preset rules based on the detection precision;
a second ratio is determined based on the parameter and the first ratio.
Further, the processor 1001 may call the image detection program stored in the memory 1005, and also perform the following operations:
determining whether the first ratio is greater than a preset ratio when it is determined that no object is present in the second image based on the detection result;
if the first proportion is smaller than a preset proportion, determining a second proportion based on the first proportion and a preset rule;
and if the first proportion is larger than or equal to a preset proportion, outputting prompt information that no object exists in the image to be detected.
Further, the processor 1001 may call the image detection program stored in the memory 1005, and also perform the following operations:
obtaining a sample corresponding to the image to be detected;
processing the sample based on a preset size to obtain a target sample;
processing the target sample based on a preset rule to obtain a training sample;
performing cross validation training on the deep neural network based on the training sample to obtain a weight file and a value of a hyper-parameter of a target deep neural network model;
determining a target deep neural network model based on the weight file and the values of the hyper-parameters.
Further, the processor 1001 may call the image detection program stored in the memory 1005, and also perform the following operations:
acquiring the sample, wherein the sample comprises an annotation image and annotation information;
adjusting the size of the marked image based on a preset size to obtain a target image;
a target sample is determined based on the target image and the annotation information.
Referring to fig. 2, fig. 2 is a flowchart illustrating an image detection method according to a first embodiment of the present invention.
The image detection method comprises the following steps:
step S10, based on a first proportion and the geometric center of the image to be detected, cutting the image to be detected to obtain a first image;
in the present embodiment, first, cropping is started from the geometric center of the image to be detected based on the first scale to obtain a processed first image. For example, an image to be detected is initially 800 × 600 in size, and is first cropped from the geometric center of the image at a ratio of x%, i.e., x% is the first ratio. Normally, x is set to 25, i.e., 1/4 for the original image, and is cut into 200 × 150 images, and the first image is the cut image.
Step S20, adjusting the size of the first image based on a preset size to obtain a second image;
in the present embodiment, the size of the preset size is first determined, and then the size of the first image is processed according to the size of the preset size, so that the size of the processed second image is equivalent to the size of the preset size. For example, the preset size is set to be a fixed size of 128 × 128, if the size of the first image is 200 × 150, the first image is processed into an image with a size of 128 × 128, and the processed image is the second image, and the preset size can be adjusted according to the real-time performance and precision requirements of the camera and the task in the specific implementation process.
Step S30, detecting the second image based on the target depth neural network model to obtain a detection result;
in the present embodiment, the second image is detected by using the target deep neural network model to obtain a detection result. The target deep neural network model is created by the following steps:
first, the class of the object in the image to be detected is determined. This is relevant for the specific task to be examined, and can be animals such as "cats", "dogs", etc., or various vehicles such as "cars", "planes", etc. Then, pictures related to the object in the image to be detected are collected, and modes such as online downloading, self-photographing and the like can be adopted. It should be noted that these photographs do not necessarily require that the object be in the center of the picture, nor that there be only one type of object in the photograph. At least 200 pictures are collected for each type of object, and the pictures cover various shapes, sizes, colors, angles, backgrounds, illumination and the like of the type of object as much as possible.
Then, a drawing tool (or a special marking tool) is used for opening a picture related to the object in the image to be detected, for each object in the picture, a rectangular frame is used for just framing the object, and the category of the object and the coordinates of the rectangular frame are marked manually. The above is manual operation.
The following is the automatic processing of the program: in the rectangular frame, a point C is randomly selected as a central point, then the maximum value A from the point to the left, right, upper and lower boundaries of the rectangular frame is calculated, the A is randomly amplified for n times (the amplification range is usually 1-1.2 times of the original size) once to obtain B, and then a square area is cut out by taking the C as the central point and taking two times of the B as the side length. It is specifically stated here that the part of the square that extends beyond the original image is filled with zeros. At this time, the cut square image must contain the object and the center of the image must fall into the object. Then, the picture is cut out (copied without changing the original picture) according to the square frame, the cut-out picture is saved as a file, and the marking information (whether an object, a category name of the object and a coordinate of the object) corresponding to the cut-out picture is saved as another file. And repeating the operation until all the objects in the picture are marked. At the same time, a corresponding number of "no object" samples are labeled in the non-object regions. And the processed image and the marking information are training samples.
Then, a network architecture based on YOLOv3 is selected to build the deep neural network, and of course, other network architectures (such as VGG, GoogleNet, etc.) may also be selected to build the deep neural network, which is not described herein again. The deep neural network is composed of a plurality of convolutional layers and pooling layers, a full-link layer and an output layer. The number of convolutional layers and pooling layers, convolutional kernel size, step size of convolutional layers, step size of pooling layers, manner (e.g., maximum pooling or average pooling), and so on may be adjusted according to the effectiveness of cross-validation training. The final output result is an N-dimensional vector which is formed by splicing the object category, the probability of each prediction frame, the coordinate of the central point of the frame, the width and the height.
The deep neural network is then trained, and the pictures in the training sample are unified in size (typically 128 × 128), and then input into the deep neural network for parameter training. The training uses classical error back propagation with the discard parameter set to 0.5. The loss function is composed of four parts, namely whether an object exists or not, whether the object type is correct or not, whether the coordinate where the object is located is correct or not and the prediction confidence of the prediction frame, wherein the final prediction is that the prediction confidence of each prediction frame is sorted from large to small to obtain the prediction frame with the maximum prediction confidence. Only when the confidence of the frame is not less than the threshold value, judging that the predicted frame has the object and the category and the coordinate of the object; otherwise, it is determined that there is no object. The overall loss function is obtained by weighted summation of the losses of the four parts. And after the training is finished, obtaining an original deep neural network model.
And (3) performing a ten-fold cross-validation method, namely taking each of the ten parts as a test sample in turn, and then checking the original deep neural network model based on the test sample to obtain the average accuracy (mAP). And adjusting various hyper-parameters of the original deep neural network model based on the average accuracy rate to reach the highest average accuracy rate. The hyper-parameters comprise a preset size, a prediction confidence threshold value of a prediction frame and the like. And performing one-time training on all the training sample sets according to the adjusted hyper-parameters to obtain a target deep neural network model.
And finally, detecting the second image based on the target depth neural network model to obtain a detection result.
And step S40, when the object exists in the second image based on the detection result, outputting the category of the object in the image to be detected and the coordinates of the object in the image to be detected based on the detection result.
In this embodiment, if the target deep neural network model detects that an object exists in the second image, the type of the object in the image to be detected and the coordinates of the object in the image to be detected are further identified, and the result is output.
The image detection method provided by the embodiment includes the steps of firstly, based on a first proportion and a geometric center of an image to be detected, cutting the image to be detected to obtain a first image, then, based on a preset size, adjusting the size of the first image to obtain a second image, then, based on a target depth neural network model, detecting the second image to obtain a detection result, and finally, when an object exists in the second image based on the detection result, outputting the type of the object in the image to be detected and the coordinate of the object in the image to be detected based on the detection result; by gradually increasing the cutting range from the center point of the image from inside to outside, the size of the image required to be processed when the central object of the image is identified is reduced, the central object of the image is quickly identified, and the efficiency and the accuracy of image identification are improved.
Based on the first embodiment, a second embodiment of the image detection method of the present invention is proposed, and step S20 further includes:
step S21, acquiring the size of the first image, and determining whether the size of the first image is larger than the preset size;
step S22, if the size of the first image is larger than the preset size, adjusting the size of the first image based on the preset size to obtain a second image.
In this embodiment, the size of the first image is first obtained, then the size of the preset size is determined, and when the size of the first image is larger than the preset size, the size of the first image is adjusted based on the preset size. For example, the first image size is 800 × 600, the preset size is set to 128 × 128, and the first image size is adjusted to 128 × 128.
Further, if the size of the first image is not larger than the preset size, the first image is uniformly adjusted to the preset size through a zooming operation. In practical applications, since the preset size is small, the first image is mostly reduced to the preset size.
In the image detection method provided in this embodiment, a size of the first image is first obtained, whether the size of the first image is larger than the preset size is determined, and if the size of the first image is larger than the preset size, the size of the first image is adjusted based on the preset size; the size of the second image to be detected can be reduced, the size of the image to be processed in the process of identifying the central object of the image is reduced, and the efficiency and the identification precision of the image identification are improved.
Based on the first embodiment, a third embodiment of the image detection method of the present invention is proposed, and after step S30, the method further includes:
step S310, when it is determined that no object exists in the second image based on the detection result, determining a second proportion based on the first proportion and a preset rule, wherein the second proportion is larger than the first proportion;
and S320, taking the second proportion as the first proportion, and continuously performing the step of cutting the image to be detected based on the first proportion and the geometric center of the image to be detected.
In this embodiment, when the target deep neural network model detects that no object exists in the second image, the first ratio is adjusted according to a preset rule to determine the second ratio. For example, if the first proportion is 25%, then the second proportion may be set to m × 25%, where m is typically set to 2, then the second proportion is 50%. And then, cutting the image to be detected based on a second proportion until an object is detected or the detection of the whole image to be detected is completed.
In the image detection method provided by this embodiment, if it is determined that no object exists in the second image based on the detection result, a second ratio is determined based on the first ratio and a preset rule, where the second ratio is greater than the first ratio, then the second ratio is used as the first ratio, and the step of clipping the image to be detected based on the first ratio and the geometric center of the image to be detected is continuously performed; the method and the device have the advantages that the whole image to be detected is detected, the omission of part of the image area to be detected in the detection process is avoided, the accuracy of the detection result is ensured, and the efficiency and the identification precision of image identification are further improved.
Based on the third embodiment, a fourth embodiment of the image detection method of the present invention is proposed, and step S310 includes:
step S311, acquiring the set detection precision, and determining the parameters corresponding to the preset rules based on the detection precision;
step S312, a second ratio is determined based on the parameter and the first ratio.
In this embodiment, the set detection accuracy is first obtained, the parameter corresponding to the preset rule is determined by the set detection accuracy, and then the second ratio is determined based on the parameter and the first ratio. For example, if the first ratio is x% and the parameter corresponding to the predetermined rule is m, the second ratio is m x%. In practical application, the detection precision and the detection speed can be balanced by adjusting the parameter m, and certainly, one of the detection precision and the detection speed can be improved by adjusting the parameter m. And if the detection precision is more emphasized, increasing the m, or decreasing the m.
The image detection method provided by the embodiment includes the steps of firstly obtaining set detection precision, determining a parameter corresponding to a preset rule based on the detection precision, and then determining a second proportion based on the parameter and a first proportion; the method and the device realize the purpose that the requirements of different conditions can be met by adjusting the detection precision in practical application, and further expand the application range of the method and the device.
Based on the third embodiment, a fifth embodiment of the image detection method of the present invention is proposed, and step S310 further includes:
step S313 of determining whether the first ratio is greater than a preset ratio when it is determined that no object is present in the second image based on the detection result;
step S314, if the first proportion is smaller than a preset proportion, determining a second proportion based on the first proportion and a preset rule;
and S315, if the first proportion is larger than or equal to a preset proportion, outputting prompt information that no object exists in the image to be detected.
In this embodiment, when it is determined that no object exists in the second image based on the detection result, it is determined whether the first ratio is greater than a preset ratio, if the first ratio is smaller than the preset ratio, a second ratio is determined based on the first ratio and a preset rule, and if the first ratio is greater than or equal to the preset ratio, a prompt message indicating that no object exists in the image to be detected is output. For example, if it is determined that there is no object in the second image and the first ratio is 90%, the preset ratio is 80%, the detection of the whole image to be detected is completed. At this time, prompt information that no object exists in the image to be detected can be output.
In the image detection method provided by this embodiment, first, when it is determined that no object exists in the second image based on the detection result, it is determined whether the first ratio is greater than a preset ratio, if the first ratio is smaller than the preset ratio, a second ratio is determined based on the first ratio and a preset rule, and if the first ratio is greater than the preset ratio, prompt information that no object exists in the image to be detected is output; by the method, whether the detection of the whole image is finished or not can be judged, the detection result is output in time, and the detection efficiency is further improved.
Based on the first embodiment, a sixth embodiment of the image detection method of the present invention is proposed, wherein step S10 is preceded by:
step S110, obtaining a sample corresponding to the image to be detected;
step S120, processing the sample based on a preset size to obtain a target sample;
step S130, processing the target sample based on a preset rule to obtain a training sample;
step S140, performing cross validation training on the deep neural network based on the training sample to obtain a weight file and a hyper-parameter value of a target deep neural network model;
and S150, determining a target deep neural network model based on the weight file and the value of the hyper-parameter.
In this embodiment, a sample corresponding to the image to be detected is obtained, the sample is processed based on a preset size to obtain a target sample, and the target sample is processed based on a preset rule, for example, the target sample may be divided into ten parts, nine parts are training samples, one part is a test sample, and each of the ten parts is sequentially used as the test sample. The method comprises the steps of firstly training an original deep neural network model by nine training samples to obtain a weight file, storing parameter values of the original deep neural network model by the weight file, then identifying a test sample by the weight file to output an identification result, then comparing the identification result with labeled information in the test sample to obtain average accuracy, and then adjusting hyper-parameters in the original deep neural network model based on the average accuracy. And performing one-time training on all the training sample sets according to the adjusted hyper-parameters to obtain a target deep neural network model.
The image detection method provided by the embodiment comprises the steps of firstly obtaining a sample corresponding to an image to be detected, then processing the sample based on a preset size to obtain a target sample, then processing the target sample based on a preset rule to obtain a training sample and a test sample, then performing parameter training through a deep neural network based on the training sample to obtain an original deep neural network model, then performing cross validation training on the deep neural network based on the training sample to obtain a weight file and a value of a hyper-parameter of the target deep neural network model, and determining the target deep neural network model based on the weight file and the value of the hyper-parameter; the original deep neural network model is verified, and the target deep neural network model is obtained by adjusting the hyper-parameters in the original deep neural network model, so that the accuracy of detection is further ensured.
Based on the sixth embodiment, a seventh embodiment of the image detection method of the present invention is proposed, and step S110 includes:
step S111, obtaining the sample, wherein the sample comprises an annotation image and annotation information;
step S112, adjusting the size of the marked image based on a preset size to obtain a target image;
in step S113, a target sample is determined based on the target image and the annotation information.
In this embodiment, an annotated image and annotation information in a sample are first obtained, and then the size of the annotated image is adjusted based on a preset size to obtain a target image. For example, if the size of the annotation image is 356 × 356 and the preset size is 128 × 128, the size of the annotation image is adjusted to 128 × 128, and the adjusted annotation image is the target image.
The image detection method provided by the embodiment comprises the steps of firstly obtaining a sample, wherein the sample comprises an annotated image and annotation information, then adjusting the size of the annotated image based on a preset size to obtain a target image, and finally determining the target sample based on the target image and the annotation information; and the marked image is zoomed to a fixed scale, so that the training data is distributed more densely, and the time for training the deep neural network is greatly reduced.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (7)

1. An image detection method, characterized by comprising the steps of:
based on a first proportion and the geometric center of an image to be detected, cutting the image to be detected to obtain a first image;
adjusting the size of the first image based on a preset size to obtain a second image;
detecting the second image based on a target deep neural network model to obtain a detection result;
when the object exists in the second image based on the detection result, outputting the category of the object in the image to be detected and the coordinate of the object in the image to be detected based on the detection result;
after the step of detecting the second image based on the target deep neural network model to obtain a detection result, the image detection method further includes:
when it is determined that no object exists in the second image based on the detection result, determining a second proportion based on the first proportion and a preset rule, wherein the second proportion is larger than the first proportion;
taking the second proportion as the first proportion, and continuously executing the step of cutting the image to be detected based on the first proportion and the geometric center of the image to be detected;
wherein the determining a second ratio based on the first ratio and a preset rule comprises:
acquiring set detection precision, and determining parameters corresponding to the preset rules based on the detection precision;
a second ratio is determined based on the parameter and the first ratio.
2. The image detection method of claim 1, wherein the step of resizing the first image based on a preset size to obtain a second image comprises:
acquiring the size of the first image, and determining whether the size of the first image is larger than the preset size;
and if the size of the first image is larger than the preset size, adjusting the size of the first image based on the preset size to obtain a second image.
3. The image detection method according to claim 1, wherein the step of determining the second ratio based on the first ratio and a preset rule when it is determined that the object does not exist in the second image based on the detection result includes:
determining whether the first ratio is greater than a preset ratio when it is determined that no object is present in the second image based on the detection result;
if the first proportion is smaller than a preset proportion, determining a second proportion based on the first proportion and a preset rule;
and if the first proportion is larger than or equal to a preset proportion, outputting prompt information that no object exists in the image to be detected.
4. The image inspection method according to any one of claims 1 to 3, wherein before the step of cropping the image to be inspected based on the first scale and the geometric center of the image to be inspected to obtain the first image, the image inspection method further comprises:
obtaining a sample corresponding to the image to be detected;
processing the sample based on a preset size to obtain a target sample;
processing the target sample based on a preset rule to obtain a training sample;
performing cross validation training on the deep neural network based on the training sample to obtain a weight file and a value of a hyper-parameter of a target deep neural network model;
determining a target deep neural network model based on the weight file and the values of the hyper-parameters.
5. The image detection method of claim 4, wherein the processing the sample based on the preset size to obtain the target sample comprises:
acquiring the sample, wherein the sample comprises an annotation image and annotation information;
adjusting the size of the marked image based on a preset size to obtain a target image;
a target sample is determined based on the target image and the annotation information.
6. An image detection apparatus, characterized in that the image detection apparatus comprises: memory, a processor and an image detection program stored on the memory and executable on the processor, the image detection program when executed by the processor implementing the steps of the method according to any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon an image detection program which, when executed by a processor, implements the steps of the image detection method according to any one of claims 1 to 5.
CN201811617149.9A 2018-12-27 2018-12-27 Image detection method, device and computer readable storage medium Active CN109685069B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811617149.9A CN109685069B (en) 2018-12-27 2018-12-27 Image detection method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811617149.9A CN109685069B (en) 2018-12-27 2018-12-27 Image detection method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109685069A CN109685069A (en) 2019-04-26
CN109685069B true CN109685069B (en) 2020-03-13

Family

ID=66190751

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811617149.9A Active CN109685069B (en) 2018-12-27 2018-12-27 Image detection method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109685069B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111127535B (en) * 2019-11-22 2023-06-20 北京华捷艾米科技有限公司 Method and device for processing hand depth image
CN114359681A (en) * 2021-12-27 2022-04-15 广东电网有限责任公司 Image recognition model training method, image recognition device, image recognition equipment and image recognition medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105787928A (en) * 2016-02-14 2016-07-20 浙江大学 Fuzzy fundus image automatic detection and screening method based on visual fuzziness
CN107067415A (en) * 2017-03-21 2017-08-18 南京航空航天大学 A kind of quick accurate positioning method of target based on images match
CN108256529A (en) * 2017-11-29 2018-07-06 深圳慎始科技有限公司 Global point cloud based on Dian Yun projected outlines signature and distribution matrix describes method
CN108268859A (en) * 2018-02-08 2018-07-10 南京邮电大学 A kind of facial expression recognizing method based on deep learning
CN108401115A (en) * 2018-04-28 2018-08-14 北京心领神绘科技有限公司 A kind of automatic amendment harvester and method of portable Image Acquisition terminal

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105096350B (en) * 2014-05-21 2019-01-11 腾讯科技(深圳)有限公司 Image detecting method and device
CN106803071B (en) * 2016-12-29 2020-02-14 浙江大华技术股份有限公司 Method and device for detecting object in image
CN108875483A (en) * 2017-09-20 2018-11-23 北京旷视科技有限公司 Image detecting method, device, system and computer-readable medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105787928A (en) * 2016-02-14 2016-07-20 浙江大学 Fuzzy fundus image automatic detection and screening method based on visual fuzziness
CN107067415A (en) * 2017-03-21 2017-08-18 南京航空航天大学 A kind of quick accurate positioning method of target based on images match
CN108256529A (en) * 2017-11-29 2018-07-06 深圳慎始科技有限公司 Global point cloud based on Dian Yun projected outlines signature and distribution matrix describes method
CN108268859A (en) * 2018-02-08 2018-07-10 南京邮电大学 A kind of facial expression recognizing method based on deep learning
CN108401115A (en) * 2018-04-28 2018-08-14 北京心领神绘科技有限公司 A kind of automatic amendment harvester and method of portable Image Acquisition terminal

Also Published As

Publication number Publication date
CN109685069A (en) 2019-04-26

Similar Documents

Publication Publication Date Title
CN109961009B (en) Pedestrian detection method, system, device and storage medium based on deep learning
US11586664B2 (en) Image retrieval method and apparatus, and electronic device
CN110348294B (en) Method and device for positioning chart in PDF document and computer equipment
CN108090508B (en) classification training method, device and storage medium
CN109815770B (en) Two-dimensional code detection method, device and system
WO2019205391A1 (en) Apparatus and method for generating vehicle damage classification model, and computer readable storage medium
CN112101317B (en) Page direction identification method, device, equipment and computer readable storage medium
CN109671020A (en) Image processing method, device, electronic equipment and computer storage medium
CN113837257B (en) Target detection method and device
CN112767354A (en) Defect detection method, device and equipment based on image segmentation and storage medium
CN111814725A (en) Early warning method for judging ignition of monitoring video based on CNN + LSTM + MLP combined neural network
CN111340213B (en) Neural network training method, electronic device, and storage medium
CN115424171A (en) Flame and smoke detection method, device and storage medium
KR20220093187A (en) Positioning method and apparatus, electronic device, computer readable storage medium
CN109685069B (en) Image detection method, device and computer readable storage medium
CN111553182A (en) Ship retrieval method and device and electronic equipment
CN111598084B (en) Defect segmentation network training method, device, equipment and readable storage medium
CN108052869B (en) Lane line recognition method, lane line recognition device and computer-readable storage medium
CN110490058B (en) Training method, device and system of pedestrian detection model and computer readable medium
CN112633066A (en) Aerial small target detection method, device, equipment and storage medium
CN113326887B (en) Text detection method, device and computer equipment
CN111476144B (en) Pedestrian attribute identification model determining method and device and computer readable storage medium
CN113537169A (en) Gesture recognition method, device, storage medium and computer program product
CN111191065B (en) Homologous image determining method and device
CN113128604A (en) Page element identification method and device, electronic equipment 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