Image recognition method and related equipment based on single hidden layer neural network

Through the evaluation-action-feedback JAF algorithm, the number of hidden neurons in a single hidden neural network is adjusted, which solves the problem that the neural network model may be overfitted or underfitted, and improves the accuracy and scope of application of image recognition.

CN113139466BActive Publication Date: 2024-11-12AEROSPACE NETWORK SECURITY TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110444011.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-23
Publication Date
2024-11-12
Estimated Expiration
2041-04-23

AI Technical Summary

Technical Problem

The prior art is difficult to effectively determine the number and depth of hidden neurons in neural networks, resulting in the model being in an overfit or underfit state, and the resource is seriously wasted.

Method used

The evaluation-action-feedback JAF algorithm is used to pre-train a single hidden layer neural network. By adjusting the number of hidden layer neurons, the model structure is adaptively optimized to ensure that the accuracy of the model on the training set and the test set meets the preset iteration. Deadline conditions.

Benefits of technology

It realizes adaptive adjustment of neural network structure, improves the accuracy of image recognition, has a wider range of application, does not require high professional background knowledge, and avoids waste of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113139466B_ABST
    Figure CN113139466B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image recognition method and related equipment based on a single hidden layer neural network. The method includes: obtaining image data input by a user, and preprocessing the image data; inputting the preprocessed image data into a target detection model for multi-label classification to obtain a category label corresponding to each image data; and outputting the image data with the category label; wherein the target detection model is a single hidden layer neural network model, and the number of neurons in a single hidden layer of the single hidden layer neural network model is determined by pre-training the neural network model using the evaluation-action-feedback (JAF) algorithm. The present disclosure provides an image recognition method and related equipment based on a single hidden layer neural network, which can adaptively adjust the neural network structure to improve the accuracy of image recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of deep learning technology, and in particular to an image recognition method based on a single hidden layer neural network and related equipment. Background Art

[0002] With the rapid development of neural network technology, neural network has become one of the most important technologies in the field of artificial intelligence. Neural networks can be used to effectively identify images. How to improve the efficiency of image recognition depends on the internal structure of the neural network. Usually, the structure of a neural network includes three parts: the number of neurons in the input layer, the number and depth of neurons in the hidden layer, and the number of neurons in the output layer. The number of neurons in the input layer is consistent with the number of features contained in the input data, and the number of neurons in the output layer is consistent with the number of categories of the data. However, the number and depth of neurons in the hidden layer cannot be directly determined according to the structure of the data. It is generally believed that the more neurons in the hidden layer and the deeper the depth, the more complex the model. However, whether a complex model is suitable for the training data can only be examined through the training results, that is, whether it is in an overfitting or underfitting state by manually judging the performance of the model on the training set and the test set. This manual inspection method will undoubtedly cause a lot of resource waste, so how to determine the number and depth of neurons in the hidden layer has become a hot and difficult problem in research. Summary of the invention

[0003] In view of this, the purpose of the present disclosure is to propose an image recognition method based on a single hidden layer neural network and related equipment.

[0004] Based on the above purpose, the present disclosure provides an image recognition method based on a single hidden layer neural network, which obtains image data input by a user and preprocesses the image data;

[0005] Inputting the preprocessed image data into a target detection model for multi-label classification to obtain a category label corresponding to each image data;

[0006] Outputting the image data with the category label;

[0007] The target detection model is a single hidden layer neural network model, and the number of neurons in a single hidden layer of the single hidden layer neural network model is determined by pre-training the neural network model using a JAF algorithm.

[0008] Furthermore, the image data is normalized.

[0009] Furthermore, the single hidden layer neural network model includes: a single hidden layer feedforward neural network model, an extreme learning machine ELM neural network model or a single hidden layer convolutional neural network model.

[0010] Furthermore, the pre-training includes:

[0011] Dividing the image sample set marked with the category label into a training set and a test set, and using the single hidden layer neural network model to calculate the accuracy of the training set and the accuracy of the test set;

[0012] Calculating a reward function based on the accuracy of the training set and the accuracy of the test set;

[0013] In response to determining that the reward function does not satisfy a preset iteration cutoff condition, calculating a change in the number of neurons in the single hidden layer based on the reward function, and adjusting the number of neurons in the single hidden layer based on the change in the number of neurons in the single hidden layer;

[0014] The single hidden layer neural network model is iteratively trained until it is determined that the reward function satisfies the preset iteration cutoff condition, so as to obtain the target detection model.

[0015] Furthermore, the calculation of the reward function based on the accuracy of the training set and the accuracy of the test set includes: the reward function is specifically:

[0016] v n =f n (x)+g n (y)

[0017] in,

[0018]

[0019]

[0020] x=q n -p n , y = 1-q n ,q n is the accuracy of the training set, p n is the accuracy of the test set, α is the maximum fitting error, and β is the expected accuracy.

[0021] Furthermore, the iteration cutoff condition includes: a difference between the reward function obtained by the current iterative training and the reward function obtained by the previous iterative training is less than a preset parameter.

[0022] Furthermore, the change in the number of neurons in the single hidden layer is calculated based on the reward function, including: the change in the number of neurons in the single hidden layer is specifically

[0023] N = int(n(v n ))

[0024] in,

[0025]

[0026] v n For the return function, the function int() rounds up.

[0027] Based on the same inventive concept, the present disclosure also provides an image recognition device based on a single hidden layer neural network, comprising:

[0028] A preprocessing module is configured to obtain image data input by a user and preprocess the image data;

[0029] A classification module is configured to input the preprocessed image data into a target detection model for multi-label classification to obtain a category label corresponding to each image data;

[0030] An output module, configured to output the image data with the category label;

[0031] The target detection model is a single hidden layer neural network model, and the number of neurons in a single hidden layer of the single hidden layer neural network model is determined by pre-training the neural network model using a JAF algorithm.

[0032] Based on the same inventive concept, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements any of the methods described above when executing the computer program.

[0033] Based on the same inventive concept, the present disclosure further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute any of the methods described above.

[0034] From the above, it can be seen that the image recognition method based on a single hidden layer neural network and related equipment provided by the present disclosure can adaptively adjust the neural network structure to improve the accuracy of image recognition. Regardless of whether the neural network structure is in an overfitting or underfitting state, corresponding adjustments can be made to ultimately generate an optimized target detection model to complete the classification and recognition of image data. The image recognition method based on a single hidden layer neural network disclosed in the present disclosure has a wider range of applications than existing methods, and does not require engineers to have high professional background knowledge. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0036] Figure 1 A schematic diagram of the process of an image recognition method based on a single hidden layer neural network according to an embodiment of the present disclosure;

[0037] Figure 2 A schematic diagram of the YALE-B face dataset according to an embodiment of the present disclosure;

[0038] Figure 3 A schematic diagram of the Oxford-IIIT Pet dataset according to an embodiment of the present disclosure;

[0039] Figure 4a This is a schematic diagram of the change trend of the model accuracy rate of Example 2 of the present disclosure;

[0040] Figure 4b This is a schematic diagram of the change trend of the reward function value of Example 2 of the present disclosure;

[0041] Figure 4c This is a schematic diagram of the change trend of the number of hidden layer neurons in Example 2 of the present disclosure;

[0042] Figure 5 It is a structural schematic diagram of an image recognition device based on a single hidden layer neural network according to an embodiment of the present disclosure;

[0043] Figure 6 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0044] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0045] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should have the usual meanings understood by people with ordinary skills in the field to which the present disclosure belongs. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.

[0046] As described in the background technology, currently commonly used methods for determining the number of hidden layer neurons include: 1) determining the number of hidden layer neurons based on genetic algorithms; 2) determining the number of hidden layer neurons using empirical formulas; 3) determining the number of hidden layer neurons using the incremental method / decremental method.

[0047] Determining the number of hidden layer neurons based on genetic algorithms is a search method derived from the perspective of biological evolution. The key lies in how to encode the network results. Commonly used encoding methods include direct encoding, indirect encoding, and grammar encoding. This algorithm performs well when the network structure is small, but the encoding is too complex in large-scale neural networks, and the evolution speed is too slow. As a result, it cannot be used in large-scale neural networks.

[0048] The empirical formula method is used to determine the number of hidden layer neurons. It is a formula for the number of hidden layer neurons summarized based on past experience. It is usually only of reference value in the same type of data set. Once the usage scenario changes, it may become completely unusable.

[0049] The increasing / decreasing method is a method of finding the optimal number of hidden layer neurons by increasing / decreasing the number of neurons. The number of hidden layer neurons preset by the increasing method is usually required to ensure that the model is underfitting. The number of hidden layer neurons preset by the decreasing method is usually required to ensure that the model is overfitting. Although it is usually possible to find a relatively suitable neural network structure, it requires a lot of experiments to find it. The most suitable neural network result is usually a very labor-intensive method and places high demands on the background knowledge of engineering designers.

[0050] The Judge-Action-Feedback (JAF) algorithm proposed in the present disclosure is a method for adjusting the parameters of the hidden layer neurons of a neural network based on the traditional trial and error method. From the experience of adjusting the number of hidden layers of a neural network, when the model prediction result is overfitting, it is necessary to reduce the complexity of the model, that is, reduce the number of hidden layer neurons. When the model prediction result is underfitting, it is necessary to increase the complexity of the model, that is, increase the number of hidden layer neurons. When the prediction result of the model is neither overfitting nor underfitting, if the performance of the test set does not meet the actual needs, it is necessary to increase the complexity of the model by a small amount so that it meets the conditions.

[0051] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.

[0052] The present invention provides an image recognition method based on a single hidden layer neural network. Figure 1 , specifically including the following steps:

[0053] Step S101: Acquire image data input by a user, and pre-process the image data.

[0054] In some embodiments, for image-type data, the preprocessing includes normalizing the data. The specific normalization method can be selected according to the actual situation. Existing normalization methods include min-max normalization method, Z-score normalization method, etc. The min-max normalization method is suitable for the situation where the amount of training data is relatively stable, that is, there will not be a large amount of new sample data. The Z-score normalization method is suitable for data sets with stable mean and stable standard deviation.

[0055] Step S102: input the preprocessed image data into a target detection model for multi-label classification to obtain a category label corresponding to each image data.

[0056] Specifically, the image data is input into a target detection model, the structure of which is pre-deployed and includes an input layer, a single hidden layer, and an output layer. After multi-label classification calculation by the target detection model, the output layer outputs the category label of each image data, wherein the category label with the largest output value in the output layer represents the category corresponding to the image data.

[0057] Step S103, outputting the image data with the category label, wherein the target detection model is a single hidden layer neural network model, and the number of neurons in a single hidden layer in the single hidden layer neural network model is determined by pre-training the neural network model using a JAF algorithm.

[0058] Specifically, the target detection model is a single hidden layer neural network model. The number of hidden layer neurons is given a value when initialized. The model is iteratively trained using the JAF algorithm to find the optimal number of neurons, so that the model is in the best state, neither underfitting nor overfitting.

[0059] In some embodiments, the image data is normalized. The data normalization may adopt a min-max normalization algorithm, specifically:

[0060]

[0061] Where max represents the maximum value of all data in a feature, and min represents the minimum value of all data in a feature. x represents the value represented by a feature in a piece of data. Normalization can also use the Z-score normalization algorithm, which is as follows:

[0062]

[0063] Where μ represents the mean of all feature data, and σ represents the standard deviation of all feature data. Different normalization methods are suitable for different types of data processing and can be selected according to actual conditions. In addition to the above two normalization methods, more suitable normalization methods can also be selected, which will not be listed here one by one.

[0064] In some embodiments, the single hidden layer neural network model includes: a single hidden layer feedforward neural network model, an extreme learning machine ELM neural network model or a single hidden layer convolutional neural network model. Different types of neural network models have different corresponding training methods. Among them, the single hidden layer feedforward neural network model or other single hidden layer convolutional neural networks can be optimized using a gradient descent algorithm, while ELM can be trained using its own algorithm to obtain neural network parameters.

[0065] In some embodiments, the pre-training includes:

[0066] Dividing the image sample set marked with the category label into a training set and a test set, and using the single hidden layer neural network model to calculate the accuracy of the training set and the accuracy of the test set;

[0067] Calculating a reward function based on the accuracy of the training set and the accuracy of the test set;

[0068] In response to determining that the reward function does not satisfy a preset iteration cutoff condition, calculating a change in the number of neurons in the single hidden layer based on the reward function, and adjusting the number of neurons in the single hidden layer based on the change in the number of neurons in the single hidden layer;

[0069] The single hidden layer neural network model is iteratively trained until it is determined that the reward function satisfies the preset iteration cutoff condition, so as to obtain the target detection model.

[0070] Specifically, the data is divided into a training set and a test set, and the division ratio can be adjusted according to the actual situation. For example, the training set is 80% of the total data, and the test set is 20% of the total data. The single hidden layer neural network model is trained based on the training set, and the accuracy of the trained single hidden layer neural network model is tested through the test set. After appropriately adjusting the model parameters, the single hidden layer neural network model is iteratively trained based on the training set and the test set.

[0071] After training the training set, the single hidden layer neural network model is obtained. The training set and the test set are input into the single hidden layer neural network model, and the accuracy of the training set and the accuracy of the test set are calculated respectively. The reward function is calculated based on the accuracy of the training set and the accuracy of the test set. When the value of the reward function meets the preset iteration cutoff condition, it means that the number of neurons in the hidden layer of the single hidden layer neural network model is appropriately set, and the single hidden layer neural network model can be directly output as the target detection model. When the value of the reward function does not meet the preset iteration cutoff condition, it means that the single hidden layer neural network model is underfitting or overfitting, and it is necessary to adjust the number of neurons in the hidden layer of the single hidden layer neural network model, so as to optimize the calculation result of the single hidden layer neural network model, and obtain the target detection model with the optimal number of neurons through continuous iterative training of the model.

[0072] In some embodiments, the reward function is calculated based on the accuracy of the training set and the accuracy of the test set, and the reward function is specifically:

[0073] v n =f n (x)+g n (y)

[0074] in,

[0075]

[0076]

[0077] x=q n -p n , y = 1-q n ,q n is the accuracy of the training set, p n is the accuracy of the test set, α is the maximum fitting error, that is, the maximum difference between the accuracy of the acceptable model in the test set and the training set, and β is the expected accuracy, that is, the accuracy that the model is expected to achieve in the training set.

[0078] The value of the reward function can reflect the current state of the target detection model, specifically:

[0079]

[0080] From the above formula, we can see that when the value of the reward function is positive, the number of hidden neurons in the target detection model is appropriate. When the value of the reward function is negative, the model is in an overfitting or underfitting state. When the model is in an overfitting state, the reward function is equal to When the model is underfitting, the value of the reward function is less than

[0081] In some embodiments, the iteration cutoff condition includes: the difference between the reward function obtained by the current iterative training and the reward function obtained by the previous iterative training is less than a preset parameter. The method for judging whether the reward function has converged is to determine whether the reward function value obtained by this iteration minus the reward function value obtained by the previous iteration is less than the preset parameter C. The value of the preset parameter C can be set and adjusted according to the specific situation. When the accuracy of the target detection model is not high, the value of the preset parameter C can be appropriately increased. If the accuracy is required to be higher, the value of the preset parameter C can be appropriately reduced. If the difference in the reward function is less than the preset parameter C, it is considered that the reward function has converged, and the target detection model at this time can be derived.

[0082] In some embodiments, if the reward function value does not converge, that is, the reward function difference is greater than the preset parameter C, then the behavior function is further calculated. The behavior function A is specifically

[0083] A=F+N

[0084] Where F is the current number of hidden layer neurons, N is the change in the number of hidden layer neurons,

[0085] N = int(n(v n ))

[0086] The function of the int() function is to round up.

[0087]

[0088] The number of neurons in the hidden layer is adjusted according to the calculated value of the behavior function A, and then the model is iteratively trained.

[0089] As mentioned above, the JAF algorithm process is summarized as follows:

[0090]

[0091]

[0092] The following is an example of an image recognition method based on a single hidden layer neural network.

[0093] Example 1: Input image dataset, such as YALE-B face dataset, reference Figure 2 ,The YALE-B dataset includes facial photos of 38 people, each of which has 64 shooting results under different lighting.

[0094] The data set is calculated using the JAF algorithm, and the final test results are shown in the following table:

[0095] Table 1. Test results of YALE-B dataset

[0096]

[0097] In this embodiment, the max-min normalization algorithm is used for data preprocessing. The data set is split into 80% training set and 20% test set, where the training set is 768 data and the test set is 192 data. The ELM neural network structure is built, with 33256 input layer neurons, 50 hidden layer neurons, and 38 output layer neurons. The initial reward function is set to v n is 0, and the prediction parameter C is set to 0.01. Parameters α=0.1, β=0.05. From the data in Table 1, it can be seen that after 4 iterations of training, the difference of the reward function is 0, which is less than the preset parameter 0.01. The reward function converges, and the iterative training ends. The final number of hidden layer neurons is 41, and the target detection model is output. The trained target detection model is used to perform face recognition on the data set. At this time, the recognition accuracy of face data is 91%.

[0098] In Example 2, an image dataset is input, such as the Oxford-IIIT Pet dataset. The Oxford-IIIT Pet dataset contains 37 categories of pet datasets, each category containing approximately 200 images. Figure 3 In this embodiment, five categories of pet images are used, including 998 image data, namely Abyssinian cat, American bulldog, pit bull, basset hound and beagle.

[0099] First, due to the different pixels of each image, the hidden layer in the target detection model modifies all image data into 128*128 pixel images, and then normalizes all image data. The normalization method uses the max-min method. The normalized data is split into a test set and a training set, with a split ratio of 80% training set data and 20% training set data. The ELM neural network structure is built, with 16834 input layer neurons, 128 hidden layer neurons, and 5 output layer neurons. The initial reward function is set to v n is 0, and the prediction parameter C is set to 0.01. Parameters α=0.1, β=0.05. The target detection model is calculated after multiple iterations. Figures 4a to 4c As shown in the figure, the horizontal axis represents the number of iterations. Figure 4a The accuracy of the model shows an upward trend. Before iterative training, the accuracy of the model was 51%. After iterative training, the accuracy of the model increased to 61%, and the model accuracy increased by 10%. Figure 4b It shows that the reward function value fluctuates towards 0 during iterative training, indicating that the model state gradually meets the conditions and is continuously optimized. Figure 4cThe number of neurons in the hidden layer increases from 128 to 191, which means the final number of neurons is 191. The target detection model is output. At this time, the accuracy of the target detection model in identifying pet categories in the pet data set is 61%.

[0100] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.

[0101] It should be noted that the above describes some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0102] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides a device for determining the number of neurons in a single hidden layer based on a neural network.

[0103] refer to Figure 5 , the image recognition device based on a single hidden layer neural network comprises:

[0104] The preprocessing module 501 is configured to obtain image data input by a user and preprocess the image data;

[0105] The classification module 502 is configured to input the pre-processed image data into a target detection model for multi-label classification to obtain a category label corresponding to each image data;

[0106] An output module 503, configured to output the image data with the category label;

[0107] The target detection model is a single hidden layer neural network model, and the number of neurons in a single hidden layer of the single hidden layer neural network model is determined by pre-training the neural network model using a JAF algorithm.

[0108] For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0109] The device of the above embodiment is used to implement the corresponding method for determining the number of neurons in a single hidden layer based on a neural network in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0110] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the image recognition method based on a single hidden layer neural network described in any of the above embodiments is implemented.

[0111] Figure 6 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.

[0112] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0113] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0114] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0115] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0116] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0117] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0118] The electronic device of the above embodiment is used to implement the corresponding image recognition method based on a single hidden layer neural network in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0119] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the image recognition method based on a single hidden layer neural network as described in any of the above embodiments.

[0120] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0121] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the image recognition method based on a single hidden layer neural network as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0122] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.

[0123] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present disclosure difficult to understand, the known power / ground connections to the integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that the embodiments of the present disclosure can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0124] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0125] The embodiments of the present disclosure are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.

Claims

1. An image recognition method based on a single hidden layer neural network, comprising: Acquire image data input by a user, and pre-process the image data; Inputting the preprocessed image data into a target detection model for multi-label classification to obtain a category label corresponding to each image data; Outputting the image data with the category label; The target detection model is a single hidden layer neural network model, and the number of neurons in a single hidden layer of the single hidden layer neural network model is determined by pre-training the neural network model using a JAF algorithm; The pre-training includes: Dividing the image sample set marked with the category label into a training set and a test set, and using the single hidden layer neural network model to calculate the accuracy of the training set and the accuracy of the test set; Calculating a reward function based on the accuracy of the training set and the accuracy of the test set; In response to determining that the reward function does not satisfy a preset iteration cutoff condition, calculating a change in the number of neurons in the single hidden layer based on the reward function, and adjusting the number of neurons in the single hidden layer based on the change in the number of neurons in the single hidden layer; Iteratively training the single hidden layer neural network model until it is determined that the reward function satisfies the preset iteration cutoff condition, so as to obtain the target detection model; The reward function is calculated based on the accuracy of the training set and the accuracy of the test set, including: the reward function is specifically: in, , , is the accuracy of the training set, is the accuracy of the test set, is the maximum fitting error, is the expected accuracy; The change in the number of neurons in the single hidden layer calculated based on the reward function includes: the change in the number of neurons in the single hidden layer is specifically: in, For the return function, the function int() rounds up.

2. The method according to claim 1, wherein: The pre-processing comprises: The image data is normalized.

3. The method according to claim 1, wherein: The single hidden layer neural network model comprises: Single hidden layer feedforward neural network model, extreme learning machine ELM neural network model or single hidden layer convolutional neural network model.

4. The method according to claim 1, wherein: The iteration cutoff condition includes: The difference between the reward function obtained by the current iterative training and the reward function obtained by the previous iterative training is less than a preset parameter.

5. An image recognition device based on a single hidden layer neural network, comprising: A preprocessing module is configured to obtain image data input by a user and preprocess the image data; A classification module is configured to input the preprocessed image data into a target detection model for multi-label classification to obtain a category label corresponding to each image data; An output module, configured to output the image data with the category label; The target detection model is a single hidden layer neural network model, and the number of neurons in a single hidden layer of the single hidden layer neural network model is determined by pre-training the neural network model using a JAF algorithm; The pre-training includes: Dividing the image sample set marked with the category label into a training set and a test set, and using the single hidden layer neural network model to calculate the accuracy of the training set and the accuracy of the test set; Calculating a reward function based on the accuracy of the training set and the accuracy of the test set; In response to determining that the reward function does not satisfy a preset iteration cutoff condition, calculating a change in the number of neurons in the single hidden layer based on the reward function, and adjusting the number of neurons in the single hidden layer based on the change in the number of neurons in the single hidden layer; Iteratively training the single hidden layer neural network model until it is determined that the reward function satisfies the preset iteration cutoff condition, so as to obtain the target detection model; The reward function is calculated based on the accuracy of the training set and the accuracy of the test set, including: the reward function is specifically: in, , , is the accuracy of the training set, is the accuracy of the test set, is the maximum fitting error, is the expected accuracy; The change in the number of neurons in the single hidden layer calculated based on the reward function includes: the change in the number of neurons in the single hidden layer is specifically: in, For the return function, the function int() rounds up.

6. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method according to any one of claims 1 to 4 when executing the computer program.

7. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 4.