Image classification method based on convolutional neural network and related device

By optimizing the convolutional neural network architecture through a phased, multi-granularity optimization method, the problem of poor model search in existing technologies is solved, and efficient and accurate image classification is achieved.

CN117237713BActive Publication Date: 2025-12-26XI AN JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311183001.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-13
Publication Date
2025-12-26
Estimated Expiration
2043-09-13

AI Technical Summary

Technical Problem

Existing automated machine learning methods struggle to effectively search for convolutional neural network models of appropriate size in image classification, resulting in poor accuracy and efficiency, and they do not support data augmentation algorithms.

Method used

A phased, multi-granularity joint optimization method is adopted. By determining the interpolation threshold of the convolutional neural network architecture, the search space is divided into coarse-grained and fine-grained spaces. The hyperparameters are optimized using the Nelder-Mead algorithm and the Hyperas open-source algorithm, and the model size is optimized by combining image data augmentation range.

Benefits of technology

It achieves a balance between search accuracy and speed in image classification, reduces computational resource overhead, and improves model efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117237713B_ABST
    Figure CN117237713B_ABST
Patent Text Reader

Abstract

The application belongs to the field of image processing, and discloses a kind of image classification method and related device based on convolutional neural network, first determine the interpolation threshold of convolutional neural network architecture, obtain the coarse-grained search space of convolutional neural network architecture, carry out coarse-grained search at the center point of coarse-grained search space by preset hyperparameter optimization method and image training data set, obtain the fine-grained search space of convolutional neural network architecture according to search result, and carry out fine-grained search in fine-grained search space by preset hyperparameter optimization method and image training data set, obtain image classification convolutional neural network model;Finally, obtain the image to be classified and input to image classification convolutional neural network model, obtain classification result.The method of the application has low complexity, high efficiency, strong practicality, realizes the consideration of search accuracy and search speed, and the obtained image classification convolutional neural network model has higher classification efficiency and classification accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of image processing, and relates to an image classification method based on a convolutional neural network and a related device. BACKGROUND

[0002] Image classification technology refers to an image processing method for distinguishing different categories of targets according to different characteristics reflected in image information. It uses a computer to quantitatively analyze an image, and classifies the image or each pixel or region in the image into a certain category among several categories to replace human visual interpretation. In the field of computer vision, the development of deep learning brings convenience to software systems. Deep neural networks driven by deep learning technology have achieved the most advanced performance in image classification tasks, promoting the development of software intelligence. As a growing trend, deep neural network models are widely studied in many fields to solve practical problems. On the other hand, deep neural networks are black box models, and many problems about neural networks have not been solved. One basic and important problem is how to design a neural network of appropriate size for a given task to obtain ideal results and achieve higher accuracy in image classification.

[0003] The academic community has made limited progress in understanding the role of width and depth parameters in designing CNNs (convolutional neural networks). VC dimension is one of these theories, which can represent the sample learning complexity of a classification model. However, for a given data set size, it only gives the asymptotic complexity of the lower limit of the model size, not the computable appropriate size. Automatic machine learning is a method to solve the model size problem, which searches for model architectures and hyperparameters that can achieve the required validation accuracy for a given data set. When designing CNNs in real-world scenarios, there are many factors to consider besides accuracy, such as power consumption and efficiency, and specific model structures have superior performance under such constraints. The mainstream automatic machine learning method is difficult to search on specific structures while balancing model size, efficiency, and performance, and does not support the currently widely used data augmentation algorithm, which leads to the image classification deep neural network model searched by the automatic machine learning method not being ideal in terms of precision and efficiency when performing image classification. SUMMARY

[0004] The present application aims to overcome the above-mentioned shortcomings of the prior art and provide an image classification method based on a convolutional neural network and a related device.

[0005] To achieve the above-mentioned purpose, the present application adopts the following technical solutions:

[0006] In a first aspect of the present application, an image classification method based on a convolutional neural network is provided, comprising:

[0007] obtaining an image training dataset and an image data augmentation range of the image training dataset;

[0008] obtaining a convolutional neural network architecture, and obtaining an interpolation threshold of the convolutional neural network architecture according to the image training dataset and the image data augmentation range of the image training dataset;

[0009] obtaining a coarse-grained search space of the convolutional neural network architecture according to the interpolation threshold of the convolutional neural network architecture, and optimizing a training hyperparameter of the convolutional neural network architecture at a center point of the coarse-grained search space by a preset hyperparameter optimization method and the image training dataset to obtain an optimized training hyperparameter;

[0010] selecting an initial point in the coarse-grained search space by a preset initial point selection method, and optimizing a size hyperparameter of the convolutional neural network architecture based on the initial point, the optimized training hyperparameter and the image training dataset by a Nelder-Mead algorithm to obtain an optimized size hyperparameter;

[0011] obtaining a fine-grained search space of the convolutional neural network architecture according to the optimized size hyperparameter, and optimizing the training hyperparameter and the size hyperparameter of the convolutional neural network architecture in the fine-grained search space by the preset hyperparameter optimization method and the image training dataset to obtain an image classification convolutional neural network model;

[0012] obtaining a classification result by inputting a to-be-classified image into the image classification convolutional neural network model.

[0013] Optionally, the image data augmentation range of the image training dataset includes random rotation, random skewing, random horizontal flipping and random cropping, wherein a maximum value of a range of the random rotation is [0°, 60°], and a maximum value of a range of the random skewing is [0°, 60°]; and the convolutional neural network architecture is a ResNet network, a VGG network or a MobileNet network.

[0014] Optionally, the obtaining of the interpolation threshold of the convolutional neural network architecture according to the image training dataset and the image data augmentation range of the image training dataset includes:

[0015] obtaining an encoding result by encoding the image data augmentation range;

[0016] obtaining an interpolation threshold expansion factor of the convolutional neural network architecture by a pre-trained support vector regression model according to the encoding result;

[0017] obtaining the interpolation threshold of the convolutional neural network architecture by multiplying the interpolation threshold expansion factor of the convolutional neural network architecture and a size of the image training dataset.

[0018] Optionally, the obtaining the coarse-grained search space of the convolutional neural network architecture according to the interpolation threshold of the convolutional neural network architecture comprises:

[0019] According to the type of the convolutional neural network architecture, the network depth value range and the network width value range of the convolutional neural network architecture are obtained, and the coarse-grained search space of the convolutional neural network architecture is determined by taking the interpolation threshold of the convolutional neural network architecture as the maximum value of the total parameters of the convolutional neural network architecture;

[0020] The center point of the coarse-grained search space is (w0, d0); wherein d0 is the intermediate value of the width hyperparameter, which is determined according to the type of the convolutional neural network architecture, when the type of the convolutional neural network architecture is ResNet network or VGG network, d0 = 18; when the type of the convolutional neural network architecture is MobileNet network, d0 = 21; w0 is the intermediate value of the depth hyperparameter, w0 is the value satisfying the nearest integer multiple of 0.25; wherein, is the size of the convolutional neural network architecture under d0 and w0, and I is the interpolation threshold of the convolutional neural network architecture.

[0021] Optionally, the preset hyperparameter optimization method is Hyperas open source algorithm.

[0022] The training hyperparameters of the convolutional neural network architecture include batch size, optimizer, learning rate, and training round number; wherein the batch size search range is 64, 128, 256, and 512, the optimizer search range is Adam and SGD, the learning rate search range is 10 -2 , 10 -3 , and 10 -4 , and the training round number search range is 100, 200, 300, 400, and 500.

[0023] Optionally, the preset initial point selection method is method 1, method 2, or method 3.

[0024] Method 1: three initial points are selected, the widths of the three initial points are respectively and , which are the values closest to the size of the convolutional neural network architecture under the interpolation threshold of the convolutional neural network architecture; when the type of the convolutional neural network architecture is ResNet network or VGG network, the depths of the three initial points are respectively 18, 18, and 34; when the type of the convolutional neural network architecture is MobileNet network, the depths of the three initial points are respectively 21, 21, and 25.

[0025] ​​Method 2: Select three initial points, the widths of which are respectively such that the size of the convolutional neural network architecture is closest to the interpolation threshold of the convolutional neural network architecture. and The values ​​are: when the convolutional neural network architecture is a ResNet or VGG network, the depths of the three initial points are 8, 8, and 42, respectively; when the convolutional neural network architecture is a MobileNet network, the depths of the three initial points are 13, 13, and 41, respectively.

[0026] Method 3: Randomly select three initial points.

[0027] Optionally, the step of optimizing the training hyperparameters and size hyperparameters of the convolutional neural network architecture in a fine-grained search space using a preset hyperparameter optimization method and an image training dataset to obtain an image classification convolutional neural network model includes:

[0028] In the fine-grained search space, based on the image training dataset, the training hyperparameters and size hyperparameters of the convolutional neural network architecture are optimized several times using the Hyperas open-source algorithm to obtain several convolutional neural network models.

[0029] Obtain the loss function of the convolutional neural network architecture, and obtain the loss function value of each convolutional neural network model on the preset image verification dataset;

[0030] The convolutional neural network model with the smallest loss function value was selected as the image classification convolutional neural network model.

[0031] In a second aspect, the present invention provides an image classification system based on a convolutional neural network, comprising:

[0032] The data acquisition module is used to acquire the image data augmentation range of the image training dataset and the image training dataset;

[0033] The interpolation threshold determination module is used to obtain the convolutional neural network architecture and, based on the image data augmentation range of the image training dataset, obtain the interpolation threshold of the convolutional neural network architecture.

[0034] The parameter optimization module is used to obtain the coarse-grained search space of the convolutional neural network architecture based on the interpolation threshold of the convolutional neural network architecture. At the center point of the coarse-grained search space, the training hyperparameters of the convolutional neural network architecture are optimized using a preset hyperparameter optimization method and the image training dataset to obtain the optimized training hyperparameters.

[0035] The coarse-grained search module is used to select an initial point in the coarse-grained search space using a preset initial point selection method. Based on the initial point, optimized training hyperparameters, and image training dataset, the Nelder-Mead algorithm is used to optimize the size hyperparameters of the convolutional neural network architecture to obtain the optimized size hyperparameters.

[0036] The fine-grained search module is used to obtain the fine-grained search space of the convolutional neural network architecture based on the optimized size hyperparameters, and to optimize the training hyperparameters and size hyperparameters of the convolutional neural network architecture in the fine-grained search space using a preset hyperparameter optimization method and an image training dataset, so as to obtain an image classification convolutional neural network model.

[0037] The image classification module is used to acquire the image to be classified and input it into the image classification convolutional neural network model to obtain the classification result.

[0038] In a third aspect, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described image classification method based on a convolutional neural network.

[0039] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described image classification method based on a convolutional neural network.

[0040] Compared with the prior art, the present invention has the following beneficial effects:

[0041] This invention presents an image classification method based on convolutional neural networks (CNNs). First, it determines the interpolation threshold of the CNN architecture. Then, it performs a joint search in both coarse-grained and fine-grained search spaces. The search range is rapidly narrowed down using a coarse-grained approach before being used for a fine-grained search, achieving a balance between search accuracy and speed. By employing a staged multi-granularity joint optimization method, the search process is divided into two stages: coarse-grained and fine-grained search. This characteristic determines the low complexity and high efficiency of the method, effectively reducing computational resource overhead during model search. In the coarse-grained search process, the model search is modeled as a multidimensional gradient-free optimization problem, resulting in a simple algorithm with strong practical applicability. Simultaneously, based on the image training dataset and the image data augmentation range of the training dataset, the interpolation threshold of the CNN architecture is redefined, providing a new approach and method for model size search under data augmentation. Ultimately, this results in a reasonably sized CNN model for image classification, effectively improving the efficiency and accuracy of image classification. Attached Figure Description

[0042] Figure 1A flow chart of the image classification method based on the convolutional neural network according to an embodiment of the present application.

[0043] Figure 2 A schematic diagram of the coarse-grained search space according to an embodiment of the present application.

[0044] Figure 3 A schematic diagram of the joint search principle according to an embodiment of the present application.

[0045] Figure 4 A block diagram of the image classification system based on the convolutional neural network according to an embodiment of the present application. DETAILED DESCRIPTION

[0046] In order to make the personnel in the art better understand the present application scheme, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.

[0047] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0048] The present application will be described in further detail below in conjunction with the drawings:

[0049] Referring to Figure 1 In an embodiment of the present application, an image classification method based on a convolutional neural network is provided, specifically an image classification method based on a convolutional neural network with joint search neural network size. By dividing the search step into two stages of coarse-grained search and fine-grained search, the size hyperparameters and training hyperparameters are optimized respectively, and then jointly optimized in a smaller search range, which has low complexity, high efficiency, and can search the size of various mainstream convolutional neural network structures.

[0050] Specifically, the image classification method based on the convolutional neural network includes the following steps:

[0051] S1: Obtain an image training dataset and an image data augmentation range of the image training dataset.

[0052] S2: Obtain a convolutional neural network architecture, and determine an interpolation threshold of the convolutional neural network architecture according to the image training dataset and the image data augmentation range of the image training dataset.

[0053] S3: Obtain a coarse-grained search space of the convolutional neural network architecture according to the interpolation threshold of the convolutional neural network architecture, and optimize a training hyperparameter of the convolutional neural network architecture at a center point of the coarse-grained search space by using a preset hyperparameter optimization method and the image training dataset, to obtain an optimized training hyperparameter.

[0054] S4: Select an initial point in the coarse-grained search space by using a preset initial point selection method, and optimize a size hyperparameter of the convolutional neural network architecture by using the Nelder-Mead algorithm based on the initial point, the optimized training hyperparameter and the image training dataset, to obtain an optimized size hyperparameter.

[0055] S5: Obtain a fine-grained search space of the convolutional neural network architecture according to the optimized size hyperparameter, and optimize the training hyperparameter and the size hyperparameter of the convolutional neural network architecture in the fine-grained search space by using the preset hyperparameter optimization method and the image training dataset, to obtain an image classification convolutional neural network model.

[0056] S6: Obtain a classification result by inputting a to-be-classified image into the image classification convolutional neural network model.

[0057] The image classification method based on the convolutional neural network firstly determines an interpolation threshold of a convolutional neural network architecture, then jointly searches a coarse-grained search space and a fine-grained search space, quickly reduces the search range in a coarse-grained manner, and then uses fine-grained search, so that the search precision and the search speed are considered. By using the multi-granularity joint optimization method in stages, the search process is divided into two stages of coarse-grained search and fine-grained search. The characteristics determine that the method has low complexity and high efficiency, and can effectively reduce the calculation resource consumption in the model search process. In the coarse-grained search process, the model search process is modeled as a multi-dimensional gradient-free optimization problem, the algorithm is simple to implement, and has strong practicality. Meanwhile, the interpolation threshold of the convolutional neural network architecture is determined again according to the image training dataset and the image data augmentation range of the image training dataset, which provides a new idea and method for model size search under data augmentation, and finally makes the size of the obtained image classification convolutional neural network model reasonable, and effectively improves the efficiency and precision of image classification.

[0058] In a possible implementation, the image data augmentation range of the image training dataset comprises: random rotation, random skewing, random horizontal flipping, and random cropping; wherein the maximum value of the range of random rotation is [0°, 60°], and the maximum value of the range of random skewing is [0°, 60°]; the convolutional neural network architecture is a ResNet network (Deep residual network), a VGG network, or a MobileNet network. The VGG network is a deep convolutional network structure proposed by the Visual Geometry Group (VGG network) of the University of Oxford. The MobileNet network is a lightweight deep convolutional network structure proposed by Google.

[0059] In a possible implementation, the interpolation threshold of the convolutional neural network architecture obtained according to the image training dataset and the image data augmentation range of the image training dataset comprises: obtaining an encoding result by encoding the image data augmentation range; obtaining an interpolation threshold expansion factor of the convolutional neural network architecture by using a pre-trained support vector regression model according to the encoding result; obtaining the size of the image training dataset, and multiplying the interpolation threshold expansion factor of the convolutional neural network architecture by the size of the image training dataset to obtain the interpolation threshold of the convolutional neural network architecture.

[0060] Specifically, a convolutional neural network architecture to be searched is obtained, the width hyperparameter and the depth hyperparameter of the convolutional neural network architecture are set as w and d, and the model is denoted as M w,d The width hyperparameter refers to the number of convolution kernels in the convolution layer with the minimum number of convolution kernels in the convolutional neural network architecture, and the depth hyperparameter refers to the number of convolution layers in the convolutional neural network architecture.

[0061] The image data augmentation range is encoded as f {r,s,h,c} r represents the amplitude of random rotation in data augmentation, s represents the amplitude of random skewing, h represents whether random horizontal flipping is performed, and c represents whether random cropping is performed.

[0062] The interpolation threshold expansion factor δ=F(r,s,h,c) is calculated by using the support vector regression model, and then the interpolation threshold I=|D t |δ, |D t | is the size of the image training dataset D t .

[0063] The support vector regression model is trained based on the relationship between the encoding results of multiple sets of image data augmentation ranges and the interpolation threshold expansion factors of the convolutional neural network architecture, and can be considered as relationship fitting.

[0064] In one possible implementation, obtaining the coarse-grained search space of the convolutional neural network architecture based on the interpolation threshold of the convolutional neural network architecture includes: obtaining the network depth value range and network width value range of the convolutional neural network architecture according to the type of the convolutional neural network architecture, and using the interpolation threshold of the convolutional neural network architecture as the maximum value of the total parameters of the convolutional neural network architecture to determine the coarse-grained search space of the convolutional neural network architecture.

[0065] Specifically, the search space of a convolutional neural network architecture is the search space of the depth parameter d and the width parameter w. The minimum search boundary of w is 1, and the minimum search boundary of d is 1 or 2, depending on the type of convolutional neural network architecture. The maximum search boundary of w is 20, and the maximum search boundary of d is 90 for ResNet, 49 for VGG, and 59 for MobileNet. Furthermore, the search space is limited by the total number of parameters in the model, constrained by the interpolation threshold I. That is, the search space is w and d. First, w and d themselves have constant range constraints, such as the constant range of w being limited to 0 to 20. Then, a function of w and d (i.e., the model size, say w*d) needs to be less than the interpolation threshold. This initially determined search space is considered the coarse-grained search space.

[0066] In one possible implementation, the center point of the coarse-grained search space is (w0, d0); where d0 is an intermediate value of the width hyperparameter, determined according to the type of convolutional neural network architecture. When the convolutional neural network architecture is a ResNet or VGG network, d0 = 18; when the convolutional neural network architecture is a MobileNet network, d0 = 21; w0 is an intermediate value of the depth hyperparameter, where w0 satisfies... of The nearest integer multiple of 0.25; where, for The size of the convolutional neural network architecture under d0, and I is the interpolation threshold of the convolutional neural network architecture.

[0067] See Figure 2 The interpolation threshold I represents the curve, and the search space is... Figure 2 The area enclosed by the four natural boundaries and curves is determined. Based on the interpolation threshold and the convolutional neural network architecture, a set of search space center points O(w0, d0) is determined, where d0 is determined by the convolutional neural network architecture. Specifically, d0 = 18 when the convolutional neural network architecture is VGG or ResNet, and d0 = 21 when the convolutional neural network architecture is MobileNet. w0 is determined by satisfying... of The nearest integer multiple of 0.25, for example, if If w0 is 0.25, then w0 is 0.26. w0 is 0.5, so that the number of convolution kernels of each layer of the final convolutional neural network model is an integer.

[0068] In a possible implementation, the preset hyperparameter optimization method is a Hyperas open source algorithm.

[0069] In a possible implementation, the training hyperparameters of the convolutional neural network architecture include batch size, optimizer, learning rate, and training rounds; the batch size search range is 64, 128, 256, and 512, the optimizer search range is Adam and SGD, the learning rate search range is 10 -2 , 10 -3 , and 10 -4 , and the training round search range is 100, 200, 300, 400, and 500.

[0070] In a possible implementation, the preset initial point selection method is method 1, method 2, or method 3; method 1: three initial points are selected, the widths of the three initial points are and , so that the size of the convolutional neural network architecture is closest to the interpolation threshold value of the convolutional neural network architecture; when the type of the convolutional neural network architecture is a ResNet network or a VGG network, the depths of the three initial points are 18, 18, and 34 respectively; when the type of the convolutional neural network architecture is a MobileNet network, the depths of the three initial points are 21, 21, and 25 respectively; method 2: three initial points are selected, the widths of the three initial points are and , so that the size of the convolutional neural network architecture is closest to the interpolation threshold value of the convolutional neural network architecture; when the type of the convolutional neural network architecture is a ResNet network or a VGG network, the depths of the three initial points are 8, 8, and 42 respectively; when the type of the convolutional neural network architecture is a MobileNet network, the depths of the three initial points are 13, 13, and 41 respectively; method 3: three initial points are randomly selected.

[0071] Specifically, referring to the ABC three points in Figure 3 , three initial points (w1, d1), (w2, d2), and (w3, d3) are selected in the coarse-grained search space, and method 1 is generally selected by default.

[0072] After the three initial points are selected, based on the image training data set, the obtained optimization training hyperparameters are used for training of the convolutional neural network architecture and verification using the verification set, to obtain model verification loss In order, the values of (w1, d1), (w2, d2), (w3, d3) are updated round by round using the Nelder-Mead method. The values of (w1, d1), (w2, d2), (w3, d3) are updated round by round using the Nelder-Mead method include: calculating the L i of the three points, and sorting (w1, d1), (w2, d2), (w3, d3) according to the size relationship of L i , that is, exchanging their position numbers, so that the new L i , i = 1, 2, 3 satisfies L1 < L2 < L3; calculating L i , i = 1, 2, 3 and the size relationship of the model validation loss at the auxiliary point to determine the position of the next point, such as calculating the model validation loss L r at the reflection point (w r , d r ) = (w1 + w2 - w3, d1 + d2 - d3), if L1 < L r < L2, then the new three points are (w1, d1), (w2, d2), (w r , d r ); when the iteration round number exceeds the set value, the reduced search space S = [min i=1,2,3 w i , πtax i=1,2,3 w i ] × [min i=1,2,3 d i , max i=1,2,3 d i ] is obtained. See the corresponding area of LMNC' in Figure 3 .

[0073] In a possible implementation, the training hyperparameters and size hyperparameters of the convolutional neural network architecture are optimized in the fine-grained search space by the preset hyperparameter optimization method and the image training data set to obtain the image classification convolutional neural network model, which includes: based on the image training data set, the training hyperparameters and size hyperparameters of the convolutional neural network architecture are optimized several times by the Hyperas open source algorithm in the fine-grained search space to obtain several convolutional neural network models; the loss function of the convolutional neural network architecture is obtained, and the loss function values of each convolutional neural network model on the preset image verification data set are obtained; the convolutional neural network model with the smallest loss function value is selected as the image classification convolutional neural network model.

[0074] Specifically, in the fine-grained search space, the depth hyperparameter, the width hyperparameter, the batch size, the optimizer, the learning rate and the training round number are jointly used for 5 rounds of search in the default search mode of the Hyperas algorithm, and in each round of search, the corresponding hyperparameter value and the corresponding convolutional neural network model are obtained, and then the optimal convolutional neural network model is selected as the image classification convolutional neural network model based on the loss function value.

[0075] Finally, the image to be classified is obtained and input into the image classification convolutional neural network model to obtain the probability of the image to be classified belonging to each category in the image training data set. Taking animal classification as an example, a plurality of cat and dog images can be set to form an image training data set, and then the image classification convolutional neural network model is obtained by the above method, which can be used to determine whether the image to be classified is a cat image or a dog image.

[0076] The image classification method based on the convolutional neural network of the present application first determines the interpolation threshold of the convolutional neural network architecture, obtains the coarse-grained search space of the convolutional neural network architecture, performs coarse-grained search at the center point of the coarse-grained search space by the preset hyperparameter optimization method and the image training data set, obtains the fine-grained search space of the convolutional neural network architecture according to the search result, and performs fine-grained search in the fine-grained search space by the preset hyperparameter optimization method and the image training data set to obtain the image classification convolutional neural network model. Finally, the image to be classified is obtained and input into the image classification convolutional neural network model to obtain the classification result. The method of the present application has low complexity, high efficiency, strong practicability, realizes the balance between search accuracy and search speed, provides a new idea and method for fixed framework model size search under data enhancement, and the obtained image classification convolutional neural network model has higher classification efficiency and classification accuracy.

[0077] The following is an apparatus embodiment of the present application, which can be used to execute the method embodiment of the present application. For details not disclosed in the apparatus embodiment, please refer to the method embodiment of the present application.

[0078] Referring to Figure 4 In another embodiment of the present application, an image classification system based on a convolutional neural network is provided, which can be used to implement the image classification method based on the convolutional neural network described above. Specifically, the image classification system based on the convolutional neural network comprises a data acquisition module, an interpolation threshold determination module, a parameter optimization module, a coarse-grained search module, a fine-grained search module and an image classification module.

[0079] The data acquisition module is configured to acquire an image training dataset and an image data augmentation range of the image training dataset; the interpolation threshold determination module is configured to acquire a convolutional neural network architecture, and obtain an interpolation threshold of the convolutional neural network architecture according to the image training dataset and the image data augmentation range of the image training dataset; the parameter optimization module is configured to obtain a coarse-grained search space of the convolutional neural network architecture according to the interpolation threshold of the convolutional neural network architecture, and optimize a training hyperparameter of the convolutional neural network architecture at a center point of the coarse-grained search space by using a preset hyperparameter optimization method and the image training dataset, to obtain an optimized training hyperparameter; the coarse-grained search module is configured to select an initial point in the coarse-grained search space by using a preset initial point selection method, and optimize a size hyperparameter of the convolutional neural network architecture by using the Nelder-Mead algorithm based on the initial point, the optimized training hyperparameter and the image training dataset, to obtain an optimized size hyperparameter; the fine-grained search module is configured to obtain a fine-grained search space of the convolutional neural network architecture according to the optimized size hyperparameter, and optimize the training hyperparameter and the size hyperparameter of the convolutional neural network architecture by using a preset hyperparameter optimization method and the image training dataset in the fine-grained search space, to obtain an image classification convolutional neural network model; and the image classification module is configured to acquire an image to be classified and input the image to the image classification convolutional neural network model, to obtain a classification result.

[0080] The foregoing embodiment of the image classification method based on the convolutional neural network relates to the functions of the functional modules of the image classification system based on the convolutional neural network in the embodiment of the present application, and thus the details are not repeated here.

[0081] The division of the modules in the embodiment of the present application is illustrative, and is only a logical function division. In actual implementation, another division mode can be used. In addition, each functional module in each embodiment of the present application can be integrated in one processor, or can be physically separated, or two or more modules can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software functional module.

[0082] In another embodiment of the present application, a computer device is provided, which comprises a processor and a memory, the memory is configured to store a computer program, the computer program comprises program instructions, and the processor is configured to execute the program instructions stored in the computer storage medium. The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, and are suitable for implementing one or more instructions, and are particularly suitable for loading and executing one or more instructions in the computer storage medium to implement a corresponding method flow or a corresponding function; the processor in the embodiments of the present application can be used for the operation of the image classification method based on the convolutional neural network.

[0083] In another embodiment of the present application, the present application further provides a storage medium, specifically a computer readable storage medium (Memory), which is a memory device in a computer device, and is configured to store programs and data. It can be understood that the computer readable storage medium herein can include an internal storage medium in the computer device, and of course can also include an expansion storage medium supported by the computer device. The computer readable storage medium provides a storage space, and the storage space stores an operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and the instructions can be one or more computer programs (including program codes). It should be noted that the computer readable storage medium herein can be a high-speed RAM memory, or a non-volatile memory such as at least one disk memory. One or more instructions stored in the computer readable storage medium can be loaded and executed by the processor to implement the corresponding steps of the image classification method based on the convolutional neural network in the above embodiments.

[0084] Those skilled in the art will appreciate that embodiments of the application can be devised for a method, a system, or a computer program product. Accordingly, the present application can be embodied in the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer readable program code.

[0085] The present application is described in reference to the flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.

[0086] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.

[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.

[0088] Finally, it should be noted that the above-mentioned embodiments are merely intended for describing and illustrating, not limiting the technical solutions of the present application. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that the specific embodiments of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the present application, and any modifications or equivalent replacements without departing from the spirit and scope of the present application should be covered in the protection scope of the claims of the present application.

Claims

1. A method for image classification based on a convolutional neural network, characterized in that, Comprise; obtaining an image training data set and an image data augmentation range of the image training data set; obtaining a convolutional neural network architecture, and obtaining an interpolation threshold value of the convolutional neural network architecture according to the image training data set and the image data augmentation range of the image training data set; obtaining a coarse-grained search space of the convolutional neural network architecture according to the interpolation threshold value of the convolutional neural network architecture, and optimizing training hyperparameters of the convolutional neural network architecture at a center point of the coarse-grained search space by a preset hyperparameter optimization method and the image training data set to obtain optimized training hyperparameters; selecting an initial point in the coarse-grained search space by a preset initial point selection method, and optimizing size hyperparameters of the convolutional neural network architecture by the Nelder-Mead algorithm based on the initial point, the optimized training hyperparameters and the image training data set to obtain optimized size hyperparameters; obtaining a fine-grained search space of the convolutional neural network architecture according to the optimized size hyperparameters, and optimizing the training hyperparameters and the size hyperparameters of the convolutional neural network architecture in the fine-grained search space by the preset hyperparameter optimization method and the image training data set to obtain an image classification convolutional neural network model; obtaining a to-be-classified image and inputting the to-be-classified image into the image classification convolutional neural network model to obtain a classification result. 2.The method of claim 1, wherein, The image data augmentation range of the image training data set comprises random rotation, random skewing, random horizontal flipping and random cropping; wherein a maximum value of the random rotation range is [0°, 60°], and a maximum value of the random skewing range is [0°, 60°]; the convolutional neural network architecture is a ResNet network, a VGG network or a MobileNet network. 3.The method of claim 1, wherein, The interpolation threshold value of the convolutional neural network architecture is obtained according to the image training data set and the image data augmentation range of the image training data set, comprising: obtaining an encoding result by encoding the image data augmentation range; obtaining an interpolation threshold value expansion factor of the convolutional neural network architecture by a pre-trained support vector regression model according to the encoding result; obtaining the size of the image training data set, and multiplying the interpolation threshold value expansion factor of the convolutional neural network architecture by the size of the image training data set to obtain the interpolation threshold value of the convolutional neural network architecture. 4.The method of claim 1, wherein, The coarse-grained search space of the convolutional neural network architecture is obtained according to the interpolation threshold value of the convolutional neural network architecture, comprising: obtaining a network depth value range and a network width value range of the convolutional neural network architecture according to the type of the convolutional neural network architecture, and determining the coarse-grained search space of the convolutional neural network architecture by taking the interpolation threshold value of the convolutional neural network architecture as a maximum value of total parameters of the convolutional neural network architecture; The coarse-grained search space center point is (w0, d0); wherein d0 is a width hyperparameter middle value, determined according to the type of the convolutional neural network architecture, when the type of the convolutional neural network architecture is a ResNet network or a VGG network, d0=18; when the type of the convolutional neural network architecture is a MobileNet network, d0=21; w0 is a depth hyperparameter middle value, w0 is an integer satisfying the nearest value of 0.25 times ; wherein, is and the size of the convolutional neural network architecture under d0, I is an interpolation threshold value of the convolutional neural network architecture. 5.The method of claim 1, wherein, the preset hyperparameter optimization method is a Hyperas open source algorithm; The training hyperparameters of the convolutional neural network architecture include batch size, optimizer, learning rate, and training epochs; wherein the batch size search range is 64, 128, 256, and 512, the optimizer search range is Adam and SGD, the learning rate search range is 10 -2 , 10 -3 , and 10 -4 , and the training epoch search range is 100, 200, 300, 400, and 500. 6.The method of claim 1, wherein, the preset initial point selection method is method 1, method 2 or method 3; Method 1: Select three initial points, the widths of which are respectively such that the size of the convolutional neural network architecture is closest to the interpolation threshold of the convolutional neural network architecture. and The values ​​are: when the convolutional neural network architecture is a ResNet or VGG network, the depths of the three initial points are 18, 18 and 34 respectively; when the convolutional neural network architecture is a MobileNet network, the depths of the three initial points are 21, 21 and 25 respectively. Method 2: three initial points are selected, the widths of the three initial points are respectively 8, 8 and 42, and the depths of the three initial points are respectively 8, 8 and 42 and when the type of the convolutional neural network architecture is a ResNet network or a VGG network; when the type of the convolutional neural network architecture is a MobileNet network, the depths of the three initial points are respectively 13, 13 and 41 method 3: randomly selecting three initial points. 7.The convolutional neural network-based image classification method of claim 1, wherein, The training hyperparameters and the size hyperparameters of the convolutional neural network architecture are optimized in the fine-grained search space by the preset hyperparameter optimization method and the image training data set to obtain the image classification convolutional neural network model, comprising: In the fine-grained search space, based on the image training dataset, the training hyperparameters and size hyperparameters of the convolutional neural network architecture are optimized several times through the Hyperas open source algorithm to obtain several convolutional neural network models; The loss function of the convolutional neural network architecture is obtained, and the loss function values of the convolutional neural network models on the preset image validation dataset are obtained; The convolutional neural network model with the smallest loss function value is selected as the image classification convolutional neural network model.

8. A convolutional neural network-based image classification system, characterized by, It comprises: A data acquisition module is configured to acquire an image training dataset and an image data augmentation range of the image training dataset; An interpolation threshold determination module is configured to acquire a convolutional neural network architecture, and obtain an interpolation threshold of the convolutional neural network architecture according to the image training dataset and the image data augmentation range of the image training dataset; A parameter optimization module is configured to obtain a coarse-grained search space of the convolutional neural network architecture according to the interpolation threshold of the convolutional neural network architecture, and optimize the training hyperparameters of the convolutional neural network architecture at the center point of the coarse-grained search space through a preset hyperparameter optimization method and the image training dataset to obtain optimized training hyperparameters; A coarse-grained search module is configured to select an initial point in the coarse-grained search space using a preset initial point selection method, and optimize the size hyperparameters of the convolutional neural network architecture based on the initial point, the optimized training hyperparameters and the image training dataset through the Nelder-Mead algorithm to obtain optimized size hyperparameters; A fine-grained search module is configured to obtain a fine-grained search space of the convolutional neural network architecture according to the optimized size hyperparameters, and optimize the training hyperparameters and size hyperparameters of the convolutional neural network architecture in the fine-grained search space through a preset hyperparameter optimization method and the image training dataset to obtain an image classification convolutional neural network model; An image classification module is configured to acquire an image to be classified and input it into the image classification convolutional neural network model to obtain a classification result.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the steps of the convolutional neural network-based image classification method according to any one of claims 1-7.

10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to realize the steps of the convolutional neural network-based image classification method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Artistic image classification method based on convolutional neural network

    CN110427990A

  • Image multi-label classification method, system and device and readable storage medium

    CN111897985A