CN113191431A - Fine-grained vehicle type identification method and device and storage medium - Google Patents

Fine-grained vehicle type identification method and device and storage medium Download PDF

Info

Publication number
CN113191431A
CN113191431A CN202110476208.0A CN202110476208A CN113191431A CN 113191431 A CN113191431 A CN 113191431A CN 202110476208 A CN202110476208 A CN 202110476208A CN 113191431 A CN113191431 A CN 113191431A
Authority
CN
China
Prior art keywords
image
sample
sample image
original
vehicle type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110476208.0A
Other languages
Chinese (zh)
Inventor
冯先成
张鑫宇
夏婉玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Institute of Technology
Original Assignee
Wuhan Institute of Technology
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 Wuhan Institute of Technology filed Critical Wuhan Institute of Technology
Priority to CN202110476208.0A priority Critical patent/CN113191431A/en
Publication of CN113191431A publication Critical patent/CN113191431A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • 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
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • G06V20/54Surveillance or monitoring of activities, e.g. for recognising suspicious objects of traffic, e.g. cars on the road, trains or boats
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/08Detecting or categorising vehicles

Landscapes

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

Abstract

The invention relates to a fine-grained vehicle type recognition method, a device and a storage medium, wherein the method comprises the steps of importing a plurality of groups of original category data sets; preprocessing each original image to obtain a sample image corresponding to the original image; carrying out data enhancement processing on each group of sample image sets to be expanded; acquiring image attributes, and respectively calculating the clustering center of each group of sample image sets based on a K-Means algorithm and the image attributes; inputting each group of training data into a model to be trained for training to obtain a training model; and inputting the sample image into the training model for recognition to obtain a recognition result of the vehicle type. The data are expanded in a preprocessing and data enhancing mode, the problem that samples are not distributed uniformly is solved, and the problem that the samples cannot be identified due to small feature difference of vehicle types and low image sample quality can be solved based on a K-Means clustering algorithm and the image attribute clustering sampling.

Description

Fine-grained vehicle type identification method and device and storage medium
Technical Field
The invention relates to the technical field of computer vision and artificial intelligence, in particular to a fine-grained vehicle type identification method, a fine-grained vehicle type identification device and a storage medium.
Background
With the rapid development of intelligent life, various applications of intelligent transportation slowly permeate into the daily life of people. Vehicle type recognition is widely applied to scenes such as high-speed intersections, parking lots, road surface monitoring and the like. The fine-grained vehicle type identification is an important part of an intelligent traffic system and is also an important research subject in the field of computer vision.
At present, vehicle types are generally recognized by using a Convolutional Neural Network (CNN) technology in fine-grained vehicle type recognition, and deep learning is driven by end-to-end data, so that the problems of high recognition difficulty and vehicle type recognition errors are caused by the influences of factors such as uneven sample quantity of vehicle types, small characteristic difference of each vehicle type, low sample quality due to environmental influences and the like.
Aiming at the problem of uneven number of image samples, the prior art achieves the balance of various vehicle type samples by undersampling multiple sample types and performing data expansion or oversampling on few sample types, but the generated samples have poor authenticity; aiming at the problems of small characteristic difference and low image sample quality of each vehicle type, the difference between samples generated by the existing single data enhancement method is small, noise is easy to amplify when a plurality of kinds of data are mixed for enhancement, and the samples under various complex environments cannot be simultaneously and well adaptively processed.
Disclosure of Invention
The invention aims to solve the technical problems of the prior art, and provides a fine-grained vehicle type identification method, a fine-grained vehicle type identification device and a storage medium.
The technical scheme for solving the technical problems is as follows, and the fine-grained vehicle type identification method comprises the following steps:
importing a plurality of groups of original category data sets, wherein each group of original category data sets comprises a plurality of original images corresponding to vehicle types;
preprocessing each original image to obtain a sample image corresponding to the original image, and obtaining a plurality of groups of sample image sets according to all the sample images, wherein each group of sample image sets comprises a plurality of sample images corresponding to the same vehicle type;
determining a sample image set to be expanded from the plurality of sample image sets according to a preset K value, and performing data enhancement processing on each group of sample image sets to be expanded to obtain an expanded sample image set;
acquiring image attributes from the unexpanded sample image set and the expanded sample image set, and respectively calculating the clustering centers of each group of unexpanded sample image set and expanded sample image set based on a K-Means clustering algorithm and the image attributes to obtain a sampling sample set corresponding to each vehicle type category;
inputting each group of training data into a model to be trained for training to obtain a training model, wherein each group of training data comprises the sampling sample set and the sample image set corresponding to each vehicle type;
and inputting the sample image into the training model for recognition to obtain a recognition result of the vehicle type.
The invention has the beneficial effects that: the original image samples are preprocessed and enhanced, so that the sample images are optimized and weakened in different degrees, the number of the sample images is expanded, the problem of uneven sample number is solved, high-quality and diversified sample images are obtained at the same time, a model with higher recognition rate and stronger generalization capability can be trained through sampling training of a K-Means clustering algorithm, the problems of small characteristic difference of a vehicle type and low image sample quality are solved, and the precision of vehicle type fine-grained recognition is improved.
On the basis of the technical scheme, the invention can be further improved as follows:
further, the preprocessing each original image to obtain a sample image corresponding to the original image includes:
and obtaining the original image, vertically cutting the original image into halves to obtain a first original sub-sample image and a second original sub-sample image with the same pixels and specifications, horizontally turning the second original sub-sample image to obtain a second original sub-sample image mirror image, and taking the first original image sub-sample image mirror image and the second original sub-sample image mirror image as sample images.
The beneficial effect of adopting the further scheme is that: the original category data set is cut and expanded by utilizing symmetry, the generalization capability of the model can be enhanced to a certain degree, and the influence of complex environmental factors such as uneven illumination, shielding and the like on the identification result is reduced.
Further, the inputting the sample image into a training model for recognition to obtain a recognition result of the vehicle type includes:
inputting the first original sub-sample image and the second original sub-sample image into a training model for recognition to obtain a first confidence rate corresponding to the first original sub-sample image and a second confidence rate corresponding to the second original sub-sample image, and selecting a vehicle type corresponding to a higher confidence rate from the first confidence rate and the second confidence rate as a recognition result.
The beneficial effect of adopting the further scheme is that: the first original sub-sample image and the second original sub-sample image are respectively identified, and the vehicle type with higher confidence rate is selected as an identification result, so that the training model has certain fault tolerance and selectivity, and the influence of complex environmental factors such as uneven illumination, shielding and the like on the identification result is reduced to a certain extent.
Further, the determining a sample image set to be expanded from a plurality of sample image sets according to a preset K value includes:
determining a sample image set of which the number of sample images is less than a preset K value as a sample image set to be expanded;
further, the data enhancement processing on each group of sample image sets to be expanded includes:
randomly selecting a data enhancement scheme to process each group of sample image sets to be expanded, wherein the data enhancement scheme comprises the following steps: gamma transformation, dark channel defogging, random shielding, Gaussian noise addition, color enhancement, fogging processing and fuzzification processing.
The beneficial effect of adopting the further scheme is that: a data enhancement scheme is randomly selected for data enhancement processing, and the sample images are optimized and weakened to different degrees to obtain more diversified image sample sets which serve as training data sources of the training model, so that the generalization capability of the training model can be enhanced, and the identification accuracy rate is improved.
Further, the image attributes include a darkness value and a sharpness;
the method comprises the steps of obtaining image attributes from an unexpanded sample image set and an expanded sample image set, respectively calculating the clustering centers of each group of unexpanded sample image set and expanded sample image set based on a K-Means clustering algorithm and the image attributes, and obtaining a sampling sample set corresponding to each vehicle type category, and comprises the following steps:
and normalizing the darkness value and the definition, based on a K-Means clustering algorithm, taking the darkness value and the definition as an abscissa and an ordinate, and calculating K image samples of each group of unexpanded sample image sets and expanded sample image sets to obtain K clustering centers, wherein each clustering center corresponds to one sampling sample, the sampling sample set corresponding to each vehicle type category comprises K sampling samples, and the sampling sample set corresponding to the vehicle type category of the expanded sample image sets also comprises the image samples of the sample image sets to be expanded.
The beneficial effect of adopting the further scheme is that: the two attribute values are uniformly scaled in a similar range, so that the convergence speed and accuracy of the model can be improved; the method is characterized in that a sample image set is reasonably over-sampled based on a K-Means clustering algorithm, a new sampling sample is obtained through calculation, finally sampled image samples reach the vicinity of a K value, particularly, a large number of category sample image sets are under-sampled, samples with stronger attribute differences can be screened out to serve as training data, the generalization capability of a training model is improved, the phenomenon of serious over-fitting of over-sampling is prevented, and the problem that the reasons of small image sample differences and low image sample quality cannot be identified is solved.
Further, the process of calculating K cluster centers for K image samples of each group of the unexpanded sample image set and the expanded sample image set includes:
s1, randomly setting points of K image sample spaces as initial clustering centers;
s2: calculating the distances from the points of other image sample spaces except the points of the K image sample spaces to the K initial clustering centers, and selecting the initial clustering center point with the closest distance as a mark category;
s3: calculating the average value of the image sample points of each label category, and taking the image sample point closest to the average value as a new clustering center;
s4: if the new clustering center point is the same as the initial clustering center point, ending, otherwise, returning to S2.
The beneficial effect of adopting the further scheme is that: the method is characterized in that a sample image set is reasonably over-sampled based on a K-Means clustering algorithm, a new sampling sample is obtained through calculation, finally sampled image samples reach the vicinity of a K value, particularly, a large number of category sample image sets are under-sampled, samples with stronger attribute differences can be screened out to serve as training data, the generalization capability of a training model is improved, the phenomenon of serious over-fitting of over-sampling is prevented, and the problem that the reasons of small image sample differences and low image sample quality cannot be identified is solved.
In order to solve the above technical problem, the present invention further provides a fine-grained vehicle type recognition apparatus, including: the device comprises an importing module, a processing module, a training module and an identifying module.
The system comprises an importing module, a judging module and a processing module, wherein the importing module is used for importing a plurality of groups of original category data sets, and each group of original category data sets comprises a plurality of original images corresponding to a vehicle type;
the processing module is used for preprocessing each original image to obtain a sample image corresponding to the original image, and obtaining a plurality of groups of sample image sets according to all the sample images, wherein each group of sample image sets comprises a plurality of sample images corresponding to the same vehicle type; determining a sample image set to be expanded from the plurality of sample image sets according to a preset K value, and performing data enhancement processing on each group of sample image sets to be expanded to obtain an expanded sample image set; acquiring image attributes from the unexpanded sample image set and the expanded sample image set, and respectively calculating the clustering centers of each group of the unexpanded sample image set and the expanded sample image set based on a K-Means clustering algorithm and the image attributes to obtain a sampling sample set corresponding to each vehicle type category;
the training module is used for inputting each group of training data into a model to be trained for training to obtain a training model, wherein each group of training data comprises the sampling sample set and the sample image set corresponding to each vehicle type;
and the identification module is used for inputting the sample image into the training model for identification to obtain an identification result of the vehicle type.
Further, the preprocessing each original image in the processing module includes:
and obtaining the original image, vertically cutting the original image into halves to obtain a first original sub-sample image and a second original sub-sample image, horizontally turning the second original sub-sample image to obtain a second original sub-sample image mirror image, and taking the first original image sub-sample and the second original image sub-sample mirror image as sample images.
Further, a fine-grained vehicle type recognition apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the computer program is executed by the processor, the fine-grained vehicle type recognition method according to any one of claims 1 to 6 is implemented.
In order to solve the above technical problem, the present invention further provides a storage medium including one or more computer programs stored thereon, which are executable by one or more processors to implement the steps of the fine-grained vehicle type recognition method as described above.
Drawings
Fig. 1 is a flowchart of a fine-grained vehicle type recognition method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an analysis distribution curve of an error sample according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating an example of an original image after being preprocessed according to an embodiment of the present invention;
fig. 4 is a structural diagram of a fine-grained vehicle type recognition apparatus according to an embodiment of the present invention.
Detailed Description
The principles and features of this invention are described below in conjunction with the following drawings, which are set forth by way of illustration only and are not intended to limit the scope of the invention.
Example 1
As shown in fig. 1, fig. 1 is a flowchart of a fine-grained vehicle type identification method provided in an embodiment of the present invention, where the fine-grained vehicle type identification method includes:
importing a plurality of groups of original category data sets, wherein each group of original category data sets comprises a plurality of original images corresponding to vehicle types;
preprocessing each original image to obtain a sample image corresponding to the original image, and obtaining a plurality of groups of sample image sets according to all the sample images, wherein each group of sample image sets comprises a plurality of sample images corresponding to the same vehicle type;
determining a sample image set to be expanded from the plurality of sample image sets according to a preset K value, and performing data enhancement processing on each group of sample image sets to be expanded to obtain an expanded sample image set;
acquiring image attributes from the unexpanded sample image set and the expanded sample image set, and respectively calculating the clustering centers of each group of unexpanded sample image set and expanded sample image set based on a K-Means clustering algorithm and the image attributes to obtain a sampling sample set corresponding to each vehicle type category;
inputting each group of training data into a model to be trained for training to obtain a training model, wherein each group of training data comprises the sampling sample set and the sample image set corresponding to each vehicle type;
and inputting the sample image into the training model for recognition to obtain a recognition result of the vehicle type.
Specifically, the process of presetting the K value is to pre-train a small sample data set through error sample analysis, as shown in fig. 2, the number of image samples of different vehicle models and an error ratio are used as reference factors, wherein the error ratio is the number of judgment errors of the category in a test set/the number of samples in the training set/100, an elbow inflection point is manually selected as a K value candidate point, experiments are respectively performed, and a candidate point with the best effect is selected as a final value of K.
In the embodiment, the image sample is changed from two aspects by performing data enhancement on the image sample, so that on one hand, the image is enhanced, and a clearer and easily-recognized image is obtained; on the other hand, the images are degraded, the images which are fuzzy and difficult to recognize are obtained, the sample images are optimized and weakened in different degrees, the number of the sample images is expanded, the problem of uneven sample number is solved, meanwhile, high-quality and diversified sample images are obtained, a model with higher recognition rate and stronger generalization capability can be trained through sampling training of a K-Means clustering algorithm, the problems of small characteristic difference of the vehicle type and low image sample quality are solved, and the precision of fine-grained recognition of the vehicle type is improved.
Preferably, as an embodiment of the present invention, the process of preprocessing the original image to obtain a sample image corresponding to the original image includes:
and obtaining the original image, vertically cutting the original image into halves to obtain a first original sub-sample image and a second original sub-sample image with the same pixels and specifications, horizontally turning the second original sub-sample image to obtain a second original sub-sample image mirror image, and taking the first original image sub-sample image mirror image and the second original sub-sample image mirror image as sample images.
Specifically, as shown in fig. 3, the original image is an image of a front-rear view angle of the vehicle, and is vertically cut in half by using symmetry of the image, and the image of the right half is horizontally flipped.
In the embodiment, the original category data set is cut and expanded by using symmetry, the generalization capability of the model can be enhanced to a certain degree, and the influence of complex environmental factors such as uneven illumination, shielding and the like on the identification result is reduced.
Preferably, as an embodiment of the present invention, the process of inputting the sample image into a training model for recognition to obtain a recognition result of the vehicle type includes:
inputting the first original sub-sample image and the second original sub-sample image into a training model for recognition to obtain a first confidence rate corresponding to the first original sub-sample image and a second confidence rate corresponding to the second original sub-sample image, and selecting a vehicle type corresponding to a higher confidence rate from the first confidence rate and the second confidence rate as a recognition result.
In the above embodiment, the first original sub-sample image and the second original sub-sample image are respectively identified, and the vehicle type with higher confidence rate is selected as the identification result, so that the training model has certain fault tolerance and selectivity, and the influence of complex environmental factors such as uneven illumination and shielding on the identification result is reduced to a certain extent.
Preferably, as an embodiment of the present invention, the determining a sample image set to be expanded from a plurality of sample image sets according to a preset K value includes:
determining a sample image set of which the number of sample images is less than a preset K value as a sample image set to be expanded;
the process of performing data enhancement processing on each group of sample image sets to be expanded comprises the following steps:
randomly selecting a data enhancement scheme to process each group of sample image sets to be expanded, wherein the data enhancement scheme comprises the following steps: gamma transformation, dark channel defogging, random shielding, Gaussian noise addition, color enhancement, fogging processing and fuzzification processing.
Specifically, for example, the gamma transformation is to perform contrast adjustment on an overexposed or underexposed gray image by using gamma transformation, the gray value of a darker area in the image is enhanced through nonlinear transformation, the gray value of an area with an overlarge gray value in the image is reduced, and the overall detailed expression of the image is enhanced through the gamma transformation; for example, the blurring process can be divided into a mean filtering blurring process and a frosting effect blurring process, and a main method adopted by a typical linear filtering algorithm is a neighborhood averaging method, which means that a template is given to a target pixel on an image, the template comprises adjacent pixels around the target pixel, and the original pixel value is replaced by the average value of all pixels in the template.
It can be understood that a data enhancement scheme is randomly selected for image enhancement processing, and the sample images are optimized and weakened to different degrees to obtain a more diversified image sample set as a training data source of a training model, so that the generalization capability of the training model can be enhanced, and the recognition accuracy can be improved.
Preferably, as an embodiment of the present invention, the image attributes include a darkness value and a sharpness;
the method comprises the steps of obtaining image attributes from an unexpanded sample image set and an expanded sample image set, respectively calculating the clustering centers of each group of unexpanded sample image set and expanded sample image set based on a K-Means clustering algorithm and the image attributes, and obtaining a sampling sample set corresponding to each vehicle type category, and comprises the following steps:
and normalizing the darkness value and the definition, based on a K-Means clustering algorithm, taking the darkness value and the definition as an abscissa and an ordinate, and calculating K image samples of each group of unexpanded sample image sets and expanded sample image sets to obtain K clustering centers, wherein each clustering center corresponds to one sampling sample, the sampling sample set corresponding to each vehicle type category comprises K sampling samples, and the sampling sample set corresponding to the vehicle type category of the expanded sample image sets also comprises the image samples of the sample image sets to be expanded. Specifically, the sample image is converted into a gray-scale map, an image dark _ sum with image pixels smaller than λ is initialized to zero, the row number r and the column number c of the gray-scale map matrix are obtained, the number of pixels of the entire radian map is calculated to be piex _ sum r × c, all pixels of the gray-scale map are traversed, and finally, an image dark value is obtained, wherein the image dark value is dark _ prop _ sum/piex _ sum.
Specifically, the image sample is converted into a gray-scale image, the variance of the gray-scale image is calculated, the variance of laplacian response of the image is calculated, after passing through a laplacian operator, edge information is detected, the value is normalized through log, and the final result is the definition of the image sample.
It can be understood that, the image is converted into a gray scale image, and then the brightness of the image is judged according to the distribution of gray scale values, so that the brightness of the image is judged, only the number of dark pixels needs to be counted, and then the total number of the pixels is divided to obtain the percentage p, and if the p is larger than the total number of the pixels, the image is judged to be dark; the principle of obtaining the sharpness of an image is related to the definition of the laplacian operator itself, which is mainly used to measure the second derivative of an image and emphasizes image regions containing rapid intensity changes, if an image contains high variance, there is a large range of response in the image, including edges and non-edges, which represents a normal image, and if the variance of the image is low, the range of response is small, which indicates that the edges in the image are small, the less edge information will be, and the image will be blurred.
Specifically, the value of the darkness value is between 0 and 1, the range of the definition is between 0 and 1000, and the value range of the definition is too large, so that the definition becomes a main factor influencing the distance during distance calculation, the influence of the darkness value is ignored, after the two attributes are normalized, the two attribute values are uniformly scaled in a similar range, and the convergence speed and the accuracy of the model can be improved.
Specifically, the unexpanded sample image set is a sample image set with a sample image quantity greater than a preset K value, and the expanded sample image set is an expanded sample image set with a sample image quantity less than a preset K value and after passing through a data enhancement scheme.
Specifically, the horizontal and vertical coordinate values of the new cluster center are the darkness value and the definition value of the sampling sample.
Specifically, "K" in the K image samples is a numerical value of the preset K value.
In the above embodiment, the two attribute values are uniformly scaled in the similar range, so that the convergence speed and accuracy of the model can be improved; reasonably oversampling a sample image set based on a K-Means clustering algorithm, obtaining a new sampling sample through calculation, and enabling the finally sampled image sample to reach the vicinity of a K value; the method has the advantages that the image set of the vehicle type samples with a large number of sample images is subjected to undersampling, the samples with stronger attribute differences can be screened out to serve as training data, the generalization capability of a training model is improved, the phenomenon of serious overfitting of oversampling is prevented, and the problem that the images cannot be identified due to small differences of the image samples and low quality of the image samples is solved.
Preferably, as an embodiment of the present invention, the process of calculating K cluster centers by using K image samples of each group of the unexpanded sample image set and the expanded sample image set includes:
s1, randomly setting points of K image sample spaces as initial clustering centers;
s2: calculating the distances from the points of other image sample spaces except the points of the K image sample spaces to the K initial clustering centers, and selecting the initial clustering center point with the closest distance as a mark category;
s3: calculating the average value of the image sample points of each label category, and taking the image sample point closest to the average value as a new clustering center;
s4: if the new clustering center point is the same as the initial clustering center point, ending, otherwise, returning to S2.
In the embodiment, the sample image set is reasonably oversampled based on the K-Means clustering algorithm, particularly, the undersampling is performed on the category sample image sets with a large number, samples with stronger attribute difference can be screened out to serve as training data, the generalization capability of a training model is improved, the phenomenon of serious overfitting of oversampling is prevented, and the problem that the oversampling cannot be identified due to small difference of image samples and low quality of image samples is solved.
As shown in fig. 4, an embodiment of the present invention provides a fine-grained vehicle type recognition apparatus, including:
the system comprises an importing module, a judging module and a processing module, wherein the importing module is used for importing a plurality of groups of original category data sets, and each group of original category data sets comprises a plurality of original images corresponding to a vehicle type;
the processing module is used for preprocessing each original image to obtain a sample image corresponding to the original image, and obtaining a plurality of groups of sample image sets according to all the sample images, wherein each group of sample image sets comprises a plurality of sample images corresponding to the same vehicle type; determining a sample image set to be expanded from the plurality of sample image sets according to a preset K value, and performing data enhancement processing on each group of sample image sets to be expanded to obtain an expanded sample image set; acquiring image attributes from the unexpanded sample image set and the expanded sample image set, and respectively calculating the clustering centers of each group of unexpanded sample image set and expanded sample image set based on a K-Means clustering algorithm and the image attributes to obtain a sampling sample set corresponding to each vehicle type category;
the training module is used for inputting each group of training data into a model to be trained for training to obtain a training model, wherein each group of training data comprises the sampling sample set and the sample image set corresponding to each vehicle type;
and the identification module is used for inputting the sample image into the training model for identification to obtain an identification result of the vehicle type.
Preferably, as an embodiment of the present invention, the preprocessing module performs preprocessing on each original image, and includes:
and obtaining the original image, vertically cutting the original image into halves to obtain a first original sub-sample image and a second original sub-sample image, horizontally turning the second original sub-sample image to obtain a second original sub-sample image mirror image, and taking the first original image sub-sample and the second original image sub-sample mirror image as sample images.
The present embodiment further provides a fine-grained vehicle type recognition apparatus, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and is characterized in that when the processor executes the computer program, steps of a fine-grained vehicle type recognition method are implemented, which are not described in detail herein.
The present embodiment further provides a storage medium, where the storage medium includes one or more computer programs stored therein, and the one or more computer programs may be executed by one or more processors to implement the above steps of the fine-grained vehicle type identification method, which is not described herein again.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The technical solutions provided by the embodiments of the present invention are described in detail above, and the principles and embodiments of the present invention are explained in this patent by applying specific examples, and the descriptions of the embodiments above are only used to help understanding the principles of the embodiments of the present invention; the present invention is not limited to the above preferred embodiments, and any modifications, equivalent replacements, improvements, etc. within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A fine-grained vehicle type identification method is characterized by comprising the following steps:
importing a plurality of groups of original category data sets, wherein each group of original category data sets comprises a plurality of original images corresponding to vehicle types; preprocessing each original image to obtain a sample image corresponding to the original image, and obtaining a plurality of groups of sample image sets according to all the sample images, wherein each group of sample image sets comprises a plurality of sample images corresponding to the same vehicle type;
determining a sample image set to be expanded from the plurality of sample image sets according to a preset K value, and performing data enhancement processing on each group of sample image sets to be expanded to obtain an expanded sample image set;
acquiring image attributes from the unexpanded sample image set and the expanded sample image set, and respectively calculating the clustering centers of each group of unexpanded sample image set and expanded sample image set based on a K-Means clustering algorithm and the image attributes to obtain a sampling sample set corresponding to each vehicle type category;
inputting each group of training data into a model to be trained for training to obtain a training model, wherein each group of training data comprises the sampling sample set and the sample image set corresponding to each vehicle type;
and inputting the sample image into the training model for recognition to obtain a recognition result of the vehicle type.
2. The fine-grained vehicle type identification method according to claim 1, wherein the preprocessing each original image to obtain a sample image corresponding to the original image comprises:
and obtaining the original image, vertically cutting the original image into halves to obtain a first original sub-sample image and a second original sub-sample image with the same pixels and specifications, horizontally turning the second original sub-sample image to obtain a second original sub-sample image mirror image, and taking the first original image sub-sample image mirror image and the second original sub-sample image mirror image as sample images.
3. The fine-grained vehicle type recognition method according to claim 2, wherein the process of inputting the sample image into a training model for recognition to obtain the recognition result of the vehicle type comprises:
inputting the first original sub-sample image and the second original sub-sample image into a training model for recognition to obtain a first confidence rate corresponding to the first original sub-sample image and a second confidence rate corresponding to the second original sub-sample image, and selecting a vehicle type corresponding to a higher confidence rate from the first confidence rate and the second confidence rate as a recognition result.
4. The fine-grained vehicle type identification method according to claim 1, wherein the determining a sample image set to be expanded from a plurality of sample image sets according to a preset K value comprises:
determining a sample image set of which the number of sample images is less than a preset K value as a sample image set to be expanded;
the process of performing data enhancement processing on each group of sample image sets to be expanded comprises the following steps:
randomly selecting a data enhancement scheme to process each group of sample image sets to be expanded, wherein the data enhancement scheme comprises the following steps: gamma transformation, dark channel defogging, random shielding, Gaussian noise addition, color enhancement, fogging processing and fuzzification processing.
5. The fine-grained vehicle type identification method according to claim 1, wherein the image attributes comprise a darkness value and a sharpness;
the method comprises the steps of obtaining image attributes from an unexpanded sample image set and an expanded sample image set, respectively calculating the clustering centers of each group of unexpanded sample image set and expanded sample image set based on a K-Means clustering algorithm and the image attributes, and obtaining a sampling sample set corresponding to each vehicle type category, and comprises the following steps:
and normalizing the darkness value and the definition, based on a K-Means clustering algorithm, taking the darkness value and the definition as an abscissa and an ordinate, and calculating K image samples of each group of unexpanded sample image sets and expanded sample image sets to obtain K clustering centers, wherein each clustering center corresponds to one sampling sample, the sampling sample set corresponding to each vehicle type category comprises K sampling samples, and the sampling sample set corresponding to the vehicle type category of the expanded sample image sets also comprises the image samples of the sample image sets to be expanded.
6. The fine-grained vehicle type identification method according to claim 5, wherein the step of calculating K clustering centers for K image samples in each group of the unexpanded sample image set and the expanded sample image set comprises:
s1, randomly setting points of K image sample spaces as initial clustering centers;
s2: calculating the distances from the points of other image sample spaces except the points of the K image sample spaces to the K initial clustering centers, and selecting the initial clustering center point with the closest distance as a mark category;
s3: calculating the average value of the image sample points of each label category, and taking the image sample point closest to the average value as a new clustering center;
s4: if the new clustering center point is the same as the initial clustering center point, ending, otherwise, returning to S2.
7. A fine-grained vehicle type recognition device is characterized by comprising:
the system comprises an importing module, a judging module and a processing module, wherein the importing module is used for importing a plurality of groups of original category data sets, and each group of original category data sets comprises a plurality of original images corresponding to a vehicle type;
the processing module is used for preprocessing each original image to obtain a sample image corresponding to the original image, and obtaining a plurality of groups of sample image sets according to all the sample images, wherein each group of sample image sets comprises a plurality of sample images corresponding to the same vehicle type; determining a sample image set to be expanded from the plurality of sample image sets according to a preset K value, and performing data enhancement processing on each group of sample image sets to be expanded to obtain an expanded sample image set; acquiring image attributes from the unexpanded sample image set and the expanded sample image set, and respectively calculating the clustering centers of each group of the unexpanded sample image set and the expanded sample image set based on a K-Means clustering algorithm and the image attributes to obtain a sampling sample set corresponding to each vehicle type category;
the training module is used for inputting each group of training data into a model to be trained for training to obtain a training model, wherein each group of training data comprises the sampling sample set and the sample image set corresponding to each vehicle type;
and the identification module is used for inputting the sample image into the training model for identification to obtain an identification result of the vehicle type.
8. The fine-grained vehicle type recognition device according to claim 7, wherein the preprocessing module preprocesses each original image and comprises:
and obtaining the original image, vertically cutting the original image into halves to obtain a first original sub-sample image and a second original sub-sample image, horizontally turning the second original sub-sample image to obtain a second original sub-sample image mirror image, and taking the first original image sub-sample and the second original image sub-sample mirror image as sample images.
9. A fine-grained vehicle type recognition apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the computer program is executed by the processor, the fine-grained vehicle type recognition method according to any one of claims 1 to 6 is implemented.
10. A storage medium comprising one or more computer programs stored thereon, the one or more computer programs being executable by one or more processors to implement the fine-grained vehicle type recognition method of any one of claims 1 to 6.
CN202110476208.0A 2021-04-29 2021-04-29 Fine-grained vehicle type identification method and device and storage medium Pending CN113191431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110476208.0A CN113191431A (en) 2021-04-29 2021-04-29 Fine-grained vehicle type identification method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110476208.0A CN113191431A (en) 2021-04-29 2021-04-29 Fine-grained vehicle type identification method and device and storage medium

Publications (1)

Publication Number Publication Date
CN113191431A true CN113191431A (en) 2021-07-30

Family

ID=76980714

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110476208.0A Pending CN113191431A (en) 2021-04-29 2021-04-29 Fine-grained vehicle type identification method and device and storage medium

Country Status (1)

Country Link
CN (1) CN113191431A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115424086A (en) * 2022-07-26 2022-12-02 北京邮电大学 Multi-view fine-granularity identification method and device, electronic equipment and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169518A (en) * 2017-05-18 2017-09-15 北京京东金融科技控股有限公司 Data classification method, device, electronic installation and computer-readable medium
CN108763283A (en) * 2018-04-13 2018-11-06 南京邮电大学 A kind of unbalanced dataset oversampler method
CN109522936A (en) * 2018-10-23 2019-03-26 北京邮电大学 A kind of layering arest neighbors lack sampling method based on cluster
CN110275910A (en) * 2019-06-20 2019-09-24 东北大学 A kind of oversampler method of unbalanced dataset
CN110298451A (en) * 2019-06-10 2019-10-01 上海冰鉴信息科技有限公司 A kind of equalization method and device of the lack of balance data set based on Density Clustering
CN111814584A (en) * 2020-06-18 2020-10-23 北京交通大学 Vehicle weight identification method under multi-view-angle environment based on multi-center measurement loss
CN112036515A (en) * 2020-11-04 2020-12-04 北京淇瑀信息科技有限公司 Oversampling method and device based on SMOTE algorithm and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169518A (en) * 2017-05-18 2017-09-15 北京京东金融科技控股有限公司 Data classification method, device, electronic installation and computer-readable medium
CN108763283A (en) * 2018-04-13 2018-11-06 南京邮电大学 A kind of unbalanced dataset oversampler method
CN109522936A (en) * 2018-10-23 2019-03-26 北京邮电大学 A kind of layering arest neighbors lack sampling method based on cluster
CN110298451A (en) * 2019-06-10 2019-10-01 上海冰鉴信息科技有限公司 A kind of equalization method and device of the lack of balance data set based on Density Clustering
CN110275910A (en) * 2019-06-20 2019-09-24 东北大学 A kind of oversampler method of unbalanced dataset
CN111814584A (en) * 2020-06-18 2020-10-23 北京交通大学 Vehicle weight identification method under multi-view-angle environment based on multi-center measurement loss
CN112036515A (en) * 2020-11-04 2020-12-04 北京淇瑀信息科技有限公司 Oversampling method and device based on SMOTE algorithm and electronic equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
于艳丽 等: "改进 K 均值聚类的不平衡数据欠采样算法", 《软件导刊》 *
周野: "基于深度学习的车型精细识别", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 *
方杰: "基于深度卷积神经网络的车型细类识别研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115424086A (en) * 2022-07-26 2022-12-02 北京邮电大学 Multi-view fine-granularity identification method and device, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN109800754B (en) Ancient font classification method based on convolutional neural network
CN113160192B (en) Visual sense-based snow pressing vehicle appearance defect detection method and device under complex background
CN106156768B (en) The vehicle registration certificate detection method of view-based access control model
CN109726195B (en) Data enhancement method and device
CN111680690B (en) Character recognition method and device
CN114549528B (en) Micro-droplet digital PCR (polymerase chain reaction) droplet detection method and system
CN108830319B (en) Image classification method and device
CN114926407A (en) Steel surface defect detection system based on deep learning
CN114926441A (en) Defect detection method and system for machining and molding injection molding part
CN113537037A (en) Pavement disease identification method, system, electronic device and storage medium
CN112686248A (en) Certificate increase and decrease type detection method and device, readable storage medium and terminal
CN113191431A (en) Fine-grained vehicle type identification method and device and storage medium
CN115587966A (en) Method and system for detecting whether parts are missing or not under condition of uneven illumination
CN111815563A (en) Retina optic disk segmentation method combining U-Net and region growing PCNN
Fernández-Caballero et al. Display text segmentation after learning best-fitted OCR binarization parameters
CN112651913B (en) Invoice seal desalination method, system, device and computer storage medium
CN112184723B (en) Image processing method and device, electronic equipment and storage medium
CN116993679A (en) Method for detecting belt abrasion of telescopic machine based on target detection
CN110175972B (en) Infrared image enhancement method based on transmission map fusion
CN116542963A (en) Float glass defect detection system and detection method based on machine learning
CN111160338A (en) Fuzzy license plate recognition method
JP2000048120A (en) Method for extracting character area of gray level image and recording medium having recorded the program thereon
Kashef et al. Adaptive enhancement and binarization techniques for degraded plate images
CN115082379A (en) Activated sludge phase contrast microscopic image floc and filamentous bacterium segmentation method
CN114241463A (en) Signature verification method and device, computer 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210730

RJ01 Rejection of invention patent application after publication