CN108038491B - Image classification method and device - Google Patents

Image classification method and device Download PDF

Info

Publication number
CN108038491B
CN108038491B CN201711138373.5A CN201711138373A CN108038491B CN 108038491 B CN108038491 B CN 108038491B CN 201711138373 A CN201711138373 A CN 201711138373A CN 108038491 B CN108038491 B CN 108038491B
Authority
CN
China
Prior art keywords
target
area
feature set
image
region
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
CN201711138373.5A
Other languages
Chinese (zh)
Other versions
CN108038491A (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.)
SHENZHEN HARZONE TECHNOLOGY CO LTD
Original Assignee
SHENZHEN HARZONE 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 HARZONE TECHNOLOGY CO LTD filed Critical SHENZHEN HARZONE TECHNOLOGY CO LTD
Priority to CN201711138373.5A priority Critical patent/CN108038491B/en
Publication of CN108038491A publication Critical patent/CN108038491A/en
Application granted granted Critical
Publication of CN108038491B publication Critical patent/CN108038491B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/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
    • 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

Landscapes

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

Abstract

The embodiment of the invention provides an image classification method and device, wherein the method comprises the following steps: acquiring a target image; performing feature analysis on the target image to obtain a first target feature set; performing area calibration on the first target feature set to obtain at least one target area and a non-target area; performing spatial operation and/or filtering operation on each target region in the at least one target region to obtain a target region feature set, and taking the target region feature set and the first target feature set corresponding to the non-target region as a second target feature set; and training the second target feature set by adopting a first preset training model to obtain a target class corresponding to the target image. By adopting the embodiment of the invention, the characteristic analysis can be carried out on the target image, and the calibration and the processing can be carried out according to the distribution characteristics of the characteristic, so that the characteristic of the target image can be increased, and the image classification can be realized under the condition of less characteristic of the image.

Description

Image classification method and device
Technical Field
The invention relates to the technical field of image processing, in particular to an image classification method and device.
Background
Deep learning is currently the predominant method for solving image classification and feature extraction. The classification training method comprises the steps of firstly converting a complete two-dimensional image into an input node of a Data layer of a depth Network (such as a Convolutional Neural Network (CNN)), providing a label as verification of an output layer, and then obtaining a prediction result through calculation of a plurality of constraint layers and Inner-Product layers for comparison with the label of the image.
Disclosure of Invention
The embodiment of the invention provides an image classification method and device, which can realize image classification under the condition of less image features.
The first aspect of the embodiments of the present invention provides an image classification method, including:
acquiring a target image;
performing feature analysis on the target image to obtain a first target feature set;
performing area calibration on the first target feature set to obtain at least one target area and a non-target area;
performing spatial operation and filtering operation on each target region in the at least one target region to obtain a target region feature set, and taking the target region feature set and the first target feature set corresponding to the non-target region as a second target feature set;
and training the second target feature set by adopting a first preset training model to obtain a target class corresponding to the target image.
A second aspect of an embodiment of the present invention provides an image classification apparatus, including:
an acquisition unit configured to acquire a target image;
the analysis unit is used for carrying out feature analysis on the target image to obtain a first target feature set;
the calibration unit is used for carrying out regional calibration on the first target feature set to obtain at least one target region and a non-target region;
the processing unit is used for carrying out space operation and filtering operation on each target area in the at least one target area to obtain a target area characteristic set, and taking the target area characteristic set and the first target characteristic set corresponding to the non-target area as a second target characteristic set;
and the training unit is used for training the second target feature set by adopting a first preset training model to obtain a target category corresponding to the target image.
In a third aspect, an embodiment of the present invention provides a mobile terminal, including: a processor and a memory; and one or more programs stored in the memory and configured to be executed by the processor, the programs including instructions for some or all of the steps as described in the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium, where the computer-readable storage medium is used for storing a computer program, where the computer program is used to make a computer execute some or all of the steps described in the first aspect of the present invention.
In a fifth aspect, embodiments of the present invention provide a computer program product, wherein the computer program product comprises a non-transitory computer-readable storage medium storing a computer program, the computer program being operable to cause a computer to perform some or all of the steps as described in the first aspect of embodiments of the present invention. The computer program product may be a software installation package.
The embodiment of the invention has the following beneficial effects:
it can be seen that, according to the embodiment of the present invention, a target image is obtained, a first target feature set is obtained by performing feature analysis on the target image, the first target feature set is subjected to region calibration to obtain at least one target region and a non-target region, spatial operation and/or filtering operation is performed on each target region in the at least one target region to obtain a target region feature set, the target region feature set and the first target feature set corresponding to the non-target region are used as second target feature sets, the second target feature set is trained by using a first preset training model to obtain a target class corresponding to the target image, so that the target image can be subjected to feature analysis and calibration and orientation processing according to the distribution characteristics of the features of the target image, and thus, the features of the target image can be increased, and further, under the condition that the image has fewer features, and realizing image classification.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a first embodiment of an image classification method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a second embodiment of an image classification method according to an embodiment of the present invention;
fig. 3a is a schematic structural diagram of an embodiment of an image classification apparatus according to an embodiment of the present invention;
FIG. 3b is a schematic structural diagram of a calibration unit of the image classification apparatus depicted in FIG. 3a according to an embodiment of the present invention;
FIG. 3c is a schematic structural diagram of a training unit of the image classification apparatus depicted in FIG. 3a according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an embodiment of an image classification apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. 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.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of the invention and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The image classification device described in the embodiment of the present invention may include a smart Phone (such as an Android Phone, an iOS Phone, a Windows Phone, etc.), a tablet computer, a video matrix, a monitoring platform, a vehicle-mounted device, a satellite, a palm computer, a notebook computer, a Mobile Internet device (MID, Mobile Internet Devices), a wearable device, and the like, which are examples and not exhaustive, and include but are not limited to the foregoing device, and of course, the image classification device may also be a server.
In the related art, the principle of the deep network is to suppress and activate the features of the whole graph, and the number of times of activation of the target feature part is increased and the suppression of the non-target part is increased through the superposition of the number of samples, so that the features are extracted. And one cannot tell directly which part of the network is what we need. That is, a new deep network cannot automatically structure image features itself, and therefore cannot allow network fixed-point learning by pointing out a certain portion of an image.
Based on the above analysis, it was determined that deep network training requires a large number of different samples, and these samples need to include the following characteristics: the label is attached, the noise is low, the characteristics are obvious, and the diversity is wide. The image classification method provided by the embodiment of the invention can be used for solving the following problems to be solved:
1. it is not easy to obtain a large number of qualified samples in real-world scenarios, especially when this classification is rare, it is difficult to obtain a sufficient number of samples even in a single scenario, let alone obtaining diverse samples.
2. When the target features are small relative to the complete image, the network is difficult to distinguish the features in a short time, and a scene with more samples and more diversity is necessary to complete training.
3. In the manual marking and machine marking processes, tens of thousands of samples are difficult to avoid the condition of missing and wrong marks, noise samples can appear, the samples have large influence on training, and especially under the condition of small features, correct features can not be extracted completely.
4. The image features are interactively interleaved in multi-dimensional features such as spatial shape, color degree, relative position and relationship, logic and the like. Sometimes difficult to distinguish and mark. Particularly, the spatial shape and the color are linear and are not clearly defined, when the natural sample is marked, the feature is not clearly defined, so that the marked sample is unstable, and the network is difficult to train.
It can be seen that, according to the embodiment of the present invention, a target image is obtained, a first target feature set is obtained by performing feature analysis on the target image, the first target feature set is subjected to region calibration to obtain at least one target region and a non-target region, spatial operation and/or filtering operation is performed on each target region in the at least one target region to obtain a target region feature set, the target region feature set and the first target feature set corresponding to the non-target region are used as second target feature sets, the second target feature set is trained by using a first preset training model to obtain a target class corresponding to the target image, so that the target image can be subjected to feature analysis and calibration and orientation processing according to the distribution characteristics of the features of the target image, and thus, the features of the target image can be increased, and further, under the condition that the image has fewer features, and realizing image classification.
Therefore, the embodiment of the invention provides a deep network directional training technology, which can greatly reduce the dependence on the number of natural samples and improve the accuracy and generalization of the model by informing the network which feature the network wants to learn and controlling the learning direction of the network.
Fig. 1 is a flowchart illustrating an image classification method according to a first embodiment of the present invention. The image classification method described in this embodiment includes the steps of:
101. and acquiring a target image.
The target image may be an image with few features, for example, for any image, feature point extraction may be performed on the image, and the feature point extraction method may be at least one of the following methods: the harris corner detection, the scale invariant feature extraction and the like can judge whether the number of feature points in a unit area is larger than a preset feature point number threshold, an image with the number of feature points in the unit area smaller than the preset feature point number threshold is a target image related to the embodiment of the invention, wherein the preset feature point number threshold can be set by a user or is defaulted by a system.
102. And performing feature extraction on the target image to obtain a first target feature set.
The target image may be subjected to feature extraction to obtain a first target feature set, where the first target feature set may include multiple features, and the features may be feature points or feature contours.
Optionally, in the step 102, performing feature analysis on the target image to obtain a first target feature set, which may be implemented as follows:
performing feature analysis on the target image from a plurality of angles to obtain the first target feature set, wherein the plurality of angles are at least two of: the spatial shape of the target image, the color of the target image, the object nesting of the image to be processed and the pose transformation of the image to be processed.
Specifically, the plurality of angles may be at least two of: the spatial shape of the target image, the color of the target image, the object nesting of the image to be processed and the posture transformation of the image to be processed. For example, the features of the target image can be analyzed graphically, the features can be analyzed independently from the dimensions of space shape, color, object nesting and posture transformation, and natural language is converted into an image feature invariant part.
103. And carrying out region calibration on the first target feature set to obtain at least one target region and a non-target region.
The first target feature set can be integrally regarded as a background area, and based on the background area, the first target feature set is divided into multiple layers, and finally at least one target area and one non-target area can be obtained.
Optionally, the at least one target area includes at least one of: a target zone, a component zone, a ground zone, a replacement zone, and a background zone.
The method and the device can process the characteristic part to construct a specific image by taking the image as a channel and by image technologies such as shielding, replacing, rotating, displacing, filtering, zooming and the like in a mode of calibrating the target area, the ground area and the background area.
The target area is the main discrimination basis part to be classified. The spatial shape of the target area typically already contains the core features and no feature implantation is performed on the interior thereof. But in cases where the natural input sample is minimal, the feature can be implanted by calibrating the component area. And judging the operation dimensions of the target area, such as displacement, coverage, rotation, scaling and the like, and determining the operation boundary of the target area.
The part area, a finer classification of the target area, adds both length and width attributes to the target area. Anchor points must be connected between the component areas, but independent space operation can be carried out on the anchor points, wherein the independent space operation comprises rotation, scaling, displacement and length-width conversion of the component areas. The operation method and the boundary judgment standard thereof operate with reference to the target area.
And the base area is used as the base of the target area, and the target area is to be nested in the base area. Nested means that the spatial manipulation of the target region is to be performed relative to the coordinates of the ground region. When the ground area has space operation, the target area must do corresponding operation.
And the range of the replacement area is selected from the next-level selection area and is used for randomly covering the content of the previous-level selection area and inhibiting unnecessary characteristics.
A background region, the main operations of which are overlay and miscut operations. The image of this region is transformed as much as possible so that all types of spatial and filtering operations can be performed. The transformation of the area needs to prepare a part of background replacement image, and the part of image should be collected from the actual working scene and replaced into the background after random miscut.
Optionally, a coverage operation, g (x) a function, x being the maximum percentage of random coverage area. The overlaid image is from a random image of the replacement area. After running g (x), the target zone is also identified as the original classification.
Optionally, a rotation operation r (p1, p2, θ), where p1, p2 are the rotation center coordinates of the target region and p2 is the anchor point coordinates of the ground region. θ is the maximum rotation angle. After running r (p1, p2, θ), the target and ground regions can also be identified as the original classification. This operation is used to increase the rotational invariance.
Optionally, the scaling operation z (x, p1), where x is the maximum scaling factor, scales centered at the p1 point, including zooming in and out. After z (x) is run, the target zone can also be identified as the original classification.
Optionally, the filtering operation f (x), where x is an index of the filter, the filter may be used to implement at least one of: smoothing, brightness processing, texture enhancement, lens transformation, style filter, noise addition processing, foreground fusion and the like. The characteristics of the boundary and the space shape are strengthened through the superposition filter, and the method can be used for classifying colors which are not in the core characteristics, inhibiting non-target characteristics and increasing the generalization.
Optionally, a miscut operation c (x), wherein x is a percentage of the miscut. This operation randomly cuts the background image edge portion by mistake, ranging from the percent of the cut to the boundary of the ground or target area.
Alternatively, the displacement operates on an m (x, y) function, x, y being the amount of maximum displacement in the horizontal direction, and the vertical direction. After running m (x, y), the combination of target zone and substrate zone can also be identified as the original classification. This operation is used to increase displacement invariance.
Optionally, in the step 103, performing area calibration on the first set of target features may include the following steps:
31. calibrating the edge points of the first target feature set layer by layer;
32. canny edge detection is carried out on the first target feature set after the edge points are calibrated layer by layer;
33. and optimizing the first target feature set after the Canny edge detection through a Bezier curve algorithm.
The method comprises the steps of carrying out region calibration on a first target feature set through edge point layer-by-layer calibration, then carrying out Canny edge detection on an image, then carrying out fitting through a Bezier curve algorithm, and optimizing the Bezier curve through weighting of edge points and Canny edges in the fitting process.
Specifically, the method may include the following steps:
b1, under the condition of no calibration, the whole image is a background area by default.
B2, selecting the mark symbol of the substrate area, marking the salient points and the concave points on the edge of the substrate area, and after one circle, returning to the starting point to mark one unit.
B3, when selecting the secondary base region, designating the primary base region.
B4, when calibrating the replacement area for the current selection area, selecting the area of the previous level for calibration, preferably selecting the area near the boundary of the two selection areas, but not selecting the overlapping area.
B5, the target zone is calibrated such that the number of edge points should be more than a specified multiple (e.g., 2 times) of the basal zone to provide an accurate fit curve, and in particular, component zones may be added to separate portions of the target zone so that features may be more easily implanted.
104. And performing spatial operation and filtering operation on each target region in the at least one target region to obtain a target region feature set, and taking the target region feature set and the first target feature set corresponding to the non-target region as a second target feature set.
Wherein the spatial operation may be at least one of: displacement, scaling, rotation, overlay, and miscut. The filtering transform may be at least one of: brightness processing, texture enhancement, lens transformation, style filters, noise and image fusion.
105. And training the second target feature set by adopting a preset training model to obtain a target class corresponding to the target image.
After the selection areas are determined, characteristic implantation parameters are set for each selection area, and the characteristic parameters are set on the basis of not influencing original classification identification. The method of testing the parameter boundaries is to process the image with a single operating function and increase the function parameters in one direction until an unrecognized boundary is reached. And the function parameters are boundary implant parameters. The parameter determines the maximum or minimum input to the operating function, the output of which is a random value at the input range.
Optionally, the first preset training model is a neural network model, and the neural network model includes a Data layer; in the step 105, training the second target feature set by using the first preset training model may include the following steps:
51. adding an oriented Data layer to any layer in front of the Data layer of the first preset training model, wherein the oriented Data layer comprises a preset calibration area and configuration parameters to obtain a second preset training model;
52. and training the second target feature set through the second preset training model.
Wherein, the preset calibration area comprises: position, angle, resolution, number of feature points, etc., and the configuration parameter may be at least one of: specifying layers, convolution kernel size, convolution kernel type, training times, etc. Before the Data layer of the depth network, a layer of oriented Data is added, which layer has the function of expanding the image to a Data volume of more than 720 times (2 main operations 6 sub-operations at least 3 selection regions at least 20 times random parameters) according to the already calibrated selections and set parameters, for example, feature implantation is performed on the input calibrated image. By the new data containing the specific characteristics, a small amount of natural input samples can be trained in a high-precision orientation mode.
It can be seen that, according to the embodiment of the present invention, a target image is obtained, a first target feature set is obtained by performing feature analysis on the target image, the first target feature set is subjected to region calibration to obtain at least one target region and a non-target region, spatial operation and/or filtering operation is performed on each target region in the at least one target region to obtain a target region feature set, the target region feature set and the first target feature set corresponding to the non-target region are used as second target feature sets, the second target feature set is trained by using a first preset training model to obtain a target class corresponding to the target image, so that the target image can be subjected to feature analysis and calibration and orientation processing according to the distribution characteristics of the features of the target image, and thus, the features of the target image can be increased, and further, under the condition that the image has fewer features, and realizing image classification.
In accordance with the above, please refer to fig. 2, which is a flowchart illustrating a second embodiment of an image classification method according to an embodiment of the present invention. The image classification method described in this embodiment includes the steps of:
201. and acquiring a target image.
The target image may be any image, such as a vehicle image, a person image, a landscape image, a scotopic image, an exposure image, and the like.
Alternatively, the target image may be an image with few features, for example, for any image, feature point extraction may be performed on the image, and then it may be determined whether or not the feature point satisfies a predetermined condition.
202. And extracting the characteristic points of the target image to obtain a plurality of characteristic points.
The method for extracting the feature points can be at least one of the following methods: harris corner detection, scale invariant feature extraction, and the like.
203. And determining the number of the characteristic points in the unit area according to the plurality of characteristic points and the size of the target image.
The number of feature points in a unit area can be obtained according to the number of the feature points/the size of the target image. The size of the image may be determined by the number of feature points.
204. And when the number of the feature points in the unit area is within a preset range, performing feature analysis on the target image to obtain a first target feature set.
If the number of the feature points in the unit area is within the preset range, performing feature analysis on the target image to obtain a first target feature set, where the preset range may be set by a user or default by a system. Of course, if the number of feature points per unit area is large or almost zero, the image classification method provided in the embodiment of the present invention may not be used.
205. And carrying out region calibration on the first target feature set to obtain at least one target region and a non-target region.
206. And performing spatial operation and/or filtering operation on each target area in the at least one target area to obtain a target area feature set, and taking the target area feature set and the first target feature set corresponding to the non-target area as a second target feature set.
207. And training the second target feature set by adopting a first preset training model to obtain a target class corresponding to the target image.
The detailed description of the steps 204 to 207 may refer to the corresponding steps 101 to 105 of the image classification method described in fig. 1, and will not be repeated herein.
It can be seen that, through the embodiments of the present invention, a target image is obtained, feature points of the target image are extracted to obtain a plurality of feature points, the number of feature points in a unit area is determined according to the plurality of feature points and the size of the target image, when the number of feature points in the unit area is within a preset range, feature analysis is performed on the target image to obtain a first target feature set, the first target feature set is subjected to region calibration to obtain at least one target region and a non-target region, spatial operation and/or filtering operation is performed on each target region in the at least one target region to obtain a target region feature set, the target region feature set and the first target feature set corresponding to the non-target region are used as second target feature sets, a first preset training model is used to train the second target feature set to obtain a target category corresponding to the target image, therefore, the target image can be subjected to feature analysis, calibration and directional processing according to the distribution characteristics of the features, so that the features of the target image can be increased, and further, image classification can be realized under the condition of less features of the image.
In accordance with the above, an apparatus for implementing the image classification method is as follows:
please refer to fig. 3a, which is a schematic structural diagram of an embodiment of an image classification apparatus according to an embodiment of the present invention. The image classification device described in this embodiment includes: the acquiring unit 301, the analyzing unit 302, the calibrating unit 303, the processing unit 304 and the training unit 305 are as follows:
an acquisition unit 301 for acquiring a target image;
an analyzing unit 302, configured to perform feature analysis on the target image to obtain a first target feature set;
a calibration unit 303, configured to perform region calibration on the first target feature set to obtain at least one target region and a non-target region;
a processing unit 304, configured to perform spatial operation and/or filtering operation on each target region in the at least one target region to obtain a target region feature set, and use the target region feature set and the first target feature set corresponding to the non-target region as a second target feature set;
the training unit 305 is configured to train the second target feature set by using a first preset training model, so as to obtain a target category corresponding to the target image.
Optionally, the parsing unit 302 is specifically configured to:
performing feature analysis on the target image from a plurality of angles to obtain the first target feature set, wherein the plurality of angles are at least two of: the spatial shape of the target image, the color of the target image, the object nesting of the image to be processed and the pose transformation of the image to be processed.
Optionally, the at least one target region comprises at least one of: a target zone, a component zone, a ground zone, a replacement zone, and a background zone.
Alternatively, as shown in fig. 3b, fig. 3b is a detailed structure of the calibration unit 303 in the image classification apparatus depicted in fig. 3a, where the calibration unit 303 may include: the calibration module 3031, the detection module 3032 and the optimization module 3033 are as follows:
a calibration module 3031, configured to perform layer-by-layer calibration on edge points of the first target feature set;
a detection module 3032, configured to perform Canny edge detection on the first target feature set after the edge points are calibrated layer by layer;
an optimizing module 3033, configured to perform optimization processing on the first target feature set after the Canny edge detection through a Bezier curve algorithm.
Optionally, the first preset training model is a neural network model, and the neural network model includes a Data layer; referring to fig. 3c, fig. 3c is a detailed structure of the training unit 305 in the image classification apparatus depicted in fig. 3a, where the training unit 305 may include: the adding module 3051 and the training module 3052 are as follows:
an adding module 3051, configured to add an orientation Data layer to any layer before the Data layer of the first preset training model, where the orientation Data layer includes a preset calibration region and configuration parameters, and obtains a second preset training model;
a training module 3052, configured to train the second target feature set through the second preset training model.
It can be seen that, by the image classification apparatus described in the embodiment of the present invention, a target image is obtained, feature analysis is performed on the target image to obtain a first target feature set, the first target feature set is subjected to region calibration to obtain at least one target region and a non-target region, spatial operation and/or filtering operation is performed on each target region in the at least one target region to obtain a target region feature set, the target region feature set and the first target feature set corresponding to the non-target region are used as a second target feature set, the second target feature set is trained by using a first preset training model to obtain a target class corresponding to the target image, so that feature analysis can be performed on the target image, calibration can be performed according to the distribution characteristics of the features, and directional processing can increase the features of the target image, further, image classification can be realized with less features of the image.
In accordance with the above, please refer to fig. 4, which is a schematic structural diagram of an embodiment of an image classification apparatus according to an embodiment of the present invention. The image classification device described in this embodiment includes: at least one input device 1000; at least one output device 2000; at least one processor 3000, e.g., a CPU; and a memory 4000, the input device 1000, the output device 2000, the processor 3000, and the memory 4000 being connected by a bus 5000.
The input device 1000 may be a touch panel, a physical button, or a mouse.
The output device 2000 may be a display screen.
The memory 4000 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 4000 is used for storing a set of program codes, and the input device 1000, the output device 2000 and the processor 3000 are used for calling the program codes stored in the memory 4000 to execute the following operations:
the processor 3000 is configured to:
acquiring a target image;
performing feature analysis on the target image to obtain a first target feature set;
performing area calibration on the first target feature set to obtain at least one target area and a non-target area;
performing spatial operation and/or filtering operation on each target region in the at least one target region to obtain a target region feature set, and taking the target region feature set and the first target feature set corresponding to the non-target region as a second target feature set;
and training the second target feature set by adopting a first preset training model to obtain a target class corresponding to the target image.
Optionally, the processor 3000 performs feature analysis on the target image to obtain a first target feature set, including:
performing feature analysis on the target image from a plurality of angles to obtain the first target feature set, wherein the plurality of angles are at least two of: the spatial shape of the target image, the color of the target image, the object nesting of the image to be processed and the pose transformation of the image to be processed.
Optionally, the at least one target region comprises at least one of: a target zone, a component zone, a ground zone, a replacement zone, and a background zone.
Optionally, the processor 3000 performs a region calibration on the first target feature set, including:
calibrating the edge points of the first target feature set layer by layer;
canny edge detection is carried out on the first target feature set after the edge points are calibrated layer by layer;
and optimizing the first target feature set after the Canny edge detection through a Bezier curve algorithm.
Optionally, the first preset training model is a neural network model, and the neural network model includes a Data layer; the processor 3000 uses a first preset training model to train the second target feature set, including:
adding an oriented Data layer to any layer in front of the Data layer of the first preset training model, wherein the oriented Data layer comprises a preset calibration area and configuration parameters to obtain a second preset training model;
and training the second target feature set through the second preset training model.
An embodiment of the present invention further provides a computer storage medium, where the computer storage medium may store a program, and the program includes some or all of the steps of any one of the image classification methods described in the above method embodiments when executed.
Embodiments of the present invention also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any one of the image classification methods as recited in the above method embodiments.
While the invention has been described in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed invention, from a review of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the word "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus (device), or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein. A computer program stored/distributed on a suitable medium supplied together with or as part of other hardware, may also take other distributed forms, such as via the Internet or other wired or wireless telecommunication systems.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable license plate location device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable license plate location device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable license plate location device to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable license plate location device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the invention has been described in conjunction with specific features and embodiments thereof, it will be evident that various modifications and combinations can be made thereto without departing from the spirit and scope of the invention. Accordingly, the specification and figures are merely exemplary of the invention as defined in the appended claims and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (8)

1. An image classification method, comprising:
acquiring a target image, wherein the number of characteristic points in a unit area of the target image is less than a preset threshold value of the number of the characteristic points;
performing feature analysis on the target image to obtain a first target feature set;
performing area calibration on the first target feature set to obtain at least one target area and a non-target area, specifically: the whole first target feature set is regarded as a background area, the first target feature set is divided in a multi-level mode to obtain at least one target area and the non-target area, the at least one target area comprises a target area, a component area, a ground area, a replacement area and a background area, the target area is used for providing a distinguishing basis for classification, the space shape of the target area comprises core features, the component area is a finer classification of the target area, and the component area increases two attributes of length and width relative to the target area; the base area is the base of the target area, the target area is nested in the base area, the range of the replacement area is selected from the next-level selection area and is used for randomly covering the content of the previous-level selection area, the selection area is an operable area, and the background area is used for realizing covering and miscut operation;
the overall first target feature set is regarded as a background region, and the first target feature set is divided in multiple levels to obtain the at least one target region and the non-target region, wherein the at least one target region comprises a target region, a component region, a ground region, a replacement region and a background region, and specifically comprises the following steps:
the default is a background area under the condition that the whole image is not calibrated;
selecting a mark symbol of the substrate area, marking the salient points and the concave points on the edge of the substrate area, after marking a circle around the edge, returning to the starting point again, and counting to mark one unit;
when the secondary base area is selected, designating the primary base area;
when a replacement area is calibrated for the current selected area, selecting an area of the previous level for calibration, and selecting an area which is near the junction of the two selected areas and is not in an overlapping area;
the target area is calibrated in such a way that the number of edge points is more than a specified multiple of the base area so as to provide an accurate fitting curve;
performing spatial operation and/or filtering operation on each target region in the at least one target region to obtain a target region feature set, and taking the target region feature set and the first target feature set corresponding to the non-target region as a second target feature set;
and training the second target feature set by adopting a first preset training model to obtain a target class corresponding to the target image.
2. The method of claim 1, wherein the performing feature analysis on the target image to obtain a first set of target features comprises:
performing feature analysis on the target image from a plurality of angles to obtain the first target feature set, wherein the plurality of angles are at least two of: the spatial shape of the target image, the color of the target image, the object nesting of the image to be processed and the posture transformation of the image to be processed.
3. The method according to claim 1 or 2, wherein the performing regional calibration on the first set of target features comprises:
calibrating the edge points of the first target feature set layer by layer;
canny edge detection is carried out on the first target feature set after the edge points are calibrated layer by layer;
and optimizing the first target feature set after the Canny edge detection through a Bezier curve algorithm.
4. The method according to claim 1 or 2, wherein the first preset training model is a neural network model, the neural network model comprising a Data layer;
the training of the second target feature set by using the first preset training model includes:
adding an oriented Data layer to any layer in front of the Data layer of the first preset training model, wherein the oriented Data layer comprises a preset calibration area and configuration parameters to obtain a second preset training model;
and training the second target feature set through the second preset training model.
5. An image classification apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a display unit, wherein the acquisition unit is used for acquiring a target image, and the target image is an image of which the number of characteristic points in a unit area is less than a preset threshold value of the number of the characteristic points;
the analysis unit is used for carrying out feature analysis on the target image to obtain a first target feature set;
a calibration unit, configured to perform area calibration on the first target feature set to obtain at least one target area and a non-target area, specifically: the whole first target feature set is regarded as a background area, the first target feature set is divided in a multi-level mode to obtain at least one target area and the non-target area, the at least one target area comprises a target area, a component area, a ground area, a replacement area and a background area, the target area is used for providing a distinguishing basis for classification, the space shape of the target area comprises core features, the component area is a finer classification of the target area, and the component area increases two attributes of length and width relative to the target area; the base area is the base of the target area, the target area is nested in the base area, the range of the replacement area is selected from the next-level selection area and is used for randomly covering the content of the previous-level selection area, the selection area is an operable area, and the background area is used for realizing covering and miscut operation;
the overall first target feature set is regarded as a background region, and the first target feature set is divided in multiple levels to obtain the at least one target region and the non-target region, wherein the at least one target region comprises a target region, a component region, a ground region, a replacement region and a background region, and specifically comprises the following steps:
the default is a background area under the condition that the whole image is not calibrated;
selecting a mark symbol of the substrate area, marking the salient points and the concave points on the edge of the substrate area, after marking a circle around the edge, returning to the starting point again, and counting to mark one unit;
when the secondary base area is selected, designating the primary base area;
when a replacement area is calibrated for the current selected area, selecting an area of the previous level for calibration, and selecting an area which is near the junction of the two selected areas and is not in an overlapping area;
the target area is calibrated in such a way that the number of edge points is more than a specified multiple of the base area so as to provide an accurate fitting curve;
the processing unit is used for carrying out spatial operation and/or filtering operation on each target area in the at least one target area to obtain a target area characteristic set, and taking the target area characteristic set and the first target characteristic set corresponding to the non-target area as a second target characteristic set;
and the training unit is used for training the second target feature set by adopting a first preset training model to obtain a target category corresponding to the target image.
6. The apparatus according to claim 5, wherein the parsing unit is specifically configured to:
performing feature analysis on the target image from a plurality of angles to obtain the first target feature set, wherein the plurality of angles are at least two of: the spatial shape of the target image, the color of the target image, the object nesting of the image to be processed and the posture transformation of the image to be processed.
7. The apparatus according to claim 5 or 6, wherein the calibration unit comprises:
the calibration module is used for calibrating the edge points of the first target feature set layer by layer;
the detection module is used for carrying out Canny edge detection on the first target feature set after the edge points are calibrated layer by layer;
and the optimization module is used for optimizing the first target feature set after the Canny edge detection through a Bezier curve algorithm.
8. The apparatus according to claim 5 or 6, wherein the first preset training model is a neural network model, and the neural network model comprises a Data layer;
the training unit includes:
the adding module is used for adding an oriented Data layer in any layer before the Data layer of the first preset training model, wherein the oriented Data layer comprises a preset calibration area and configuration parameters to obtain a second preset training model;
and the training module is used for training the second target feature set through the second preset training model.
CN201711138373.5A 2017-11-16 2017-11-16 Image classification method and device Active CN108038491B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711138373.5A CN108038491B (en) 2017-11-16 2017-11-16 Image classification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711138373.5A CN108038491B (en) 2017-11-16 2017-11-16 Image classification method and device

Publications (2)

Publication Number Publication Date
CN108038491A CN108038491A (en) 2018-05-15
CN108038491B true CN108038491B (en) 2020-12-11

Family

ID=62092861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711138373.5A Active CN108038491B (en) 2017-11-16 2017-11-16 Image classification method and device

Country Status (1)

Country Link
CN (1) CN108038491B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108960290A (en) * 2018-06-08 2018-12-07 Oppo广东移动通信有限公司 Image processing method, device, computer readable storage medium and electronic equipment
CN109611905B (en) * 2018-12-03 2021-06-01 南京幸庄科技创新产业园管理有限公司 Rotating disc stable maintaining platform
CN112215272A (en) * 2020-09-29 2021-01-12 重庆大学 Bezier curve-based image classification neural network attack method
CN115187824A (en) * 2021-03-22 2022-10-14 华为技术有限公司 Model training method, scene recognition method and related equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8295543B2 (en) * 2007-08-31 2012-10-23 Lockheed Martin Corporation Device and method for detecting targets in images based on user-defined classifiers
CN103020971A (en) * 2012-12-28 2013-04-03 青岛爱维互动信息技术有限公司 Method for automatically segmenting target objects from images
WO2017015947A1 (en) * 2015-07-30 2017-02-02 Xiaogang Wang A system and a method for object tracking
CN106097340A (en) * 2016-06-12 2016-11-09 山东大学 A kind of method automatically detecting and delineating Lung neoplasm position based on convolution grader
CN106650660A (en) * 2016-12-19 2017-05-10 深圳市华尊科技股份有限公司 Vehicle type recognition method and terminal
CN107122806B (en) * 2017-05-16 2019-12-31 北京京东尚科信息技术有限公司 Sensitive image identification method and device

Also Published As

Publication number Publication date
CN108038491A (en) 2018-05-15

Similar Documents

Publication Publication Date Title
CN108038491B (en) Image classification method and device
CN107358149B (en) Human body posture detection method and device
CN108875511B (en) Image generation method, device, system and computer storage medium
CN106447721B (en) Image shadow detection method and device
US9349076B1 (en) Template-based target object detection in an image
CN104657936B (en) Method and electronic installation for percentage regulation value
US9245350B1 (en) Image-based color palette generation
CN110472534A (en) 3D object detection method, device, equipment and storage medium based on RGB-D data
CN109977997B (en) Image target detection and segmentation method based on convolutional neural network rapid robustness
CN108875534B (en) Face recognition method, device, system and computer storage medium
EP2908287B1 (en) Image segmentation device, image segmentation method, and depth map generating method
CN110765891B (en) Engineering drawing identification method, electronic equipment and related product
CN106484692A (en) A kind of method for searching three-dimension model
CN107272899B (en) VR (virtual reality) interaction method and device based on dynamic gestures and electronic equipment
CN109740416B (en) Target tracking method and related product
CN108762740B (en) Page data generation method and device and electronic equipment
CN114581491B (en) Pedestrian trajectory tracking method, system and related device
CN111401278A (en) Helmet identification method and device, electronic equipment and storage medium
CN108520263B (en) Panoramic image identification method and system and computer storage medium
CN109377502A (en) A kind of image processing method, image processing apparatus and terminal device
CN111597845A (en) Two-dimensional code detection method, device and equipment and readable storage medium
CN113705294A (en) Image identification method and device based on artificial intelligence
CN111260564A (en) Image processing method and device and computer storage medium
CN106033613B (en) Method for tracking target and device
CN111583159A (en) Image completion method and device and electronic equipment

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