Image recognition method, device, equipment and storage medium

By normalizing the image to be recognized and using a pre-trained convolutional neural network model to determine the category label, the problem of low image recognition accuracy in the existing technology is solved and the accuracy and efficiency of recognition are improved.

CN113269276BActive Publication Date: 2024-10-01SHAANXI QIANYI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110723034.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-28
Publication Date
2024-10-01
Estimated Expiration
2041-06-28

AI Technical Summary

Technical Problem

The accuracy of image recognition in the existing technology is low, resulting in a high rate of misjudgment when identifying a large number of images, and the inability to effectively screen and filter non-compliant images.

Method used

By obtaining the image to be recognized and performing normalization processing, the normalization matrix is ​​determined, and the pre-trained convolutional neural network model is used to determine the image category label to complete the recognition and labeling of the image.

Benefits of technology

It improves the accuracy of image recognition, reduces the misjudgment rate, and achieves effective screening and filtering of non-compliant images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113269276B_ABST
    Figure CN113269276B_ABST
Patent Text Reader

Abstract

The present invention discloses an image recognition method, device, equipment and storage medium, including: acquiring an image to be recognized, performing normalization processing on each image to obtain a normalized image set; determining normalized matrix data according to the normalized image set; determining the category label of each image according to the normalized matrix data and a pre-trained convolutional neural network model; marking each image according to the category label of each image, and completing image recognition of the image to be recognized. Since the present invention performs normalization processing on images in the image to be recognized, determines normalized matrix data according to the normalized images, determines image labels according to the normalized matrix data and a pre-trained convolutional neural network, and marks each image according to the image labels, thereby completing image recognition of the image to be recognized, the technical problem of high misjudgment rate when recognizing a large amount of image data in the prior art is solved, and the accuracy of image recognition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to an image recognition method, device, equipment and storage medium. Background Art

[0002] With the continuous development of artificial intelligence and deep learning, the mature application of high-tech has provided more convenient assistance for human life and work, simplified the tedious and mechanical operations that humans needed to do a few years ago, and greatly improved people's work efficiency and quality of life. With the advent of the Internet big data era, the number of images uploaded and browsed by users on the Internet has grown exponentially, but the quality of images on the Internet is uneven. While it is convenient for users to obtain rich image resources, the number of non-compliant images has gradually increased and flooded the Internet. Therefore, how to screen and filter non-compliant images on the Internet through effective means and provide users with a clean network environment is a very necessary and significant task.

[0003] In the existing technology, non-compliant images are generally screened through manual screening to achieve the purpose of purifying the cyberspace. Computers can also automatically extract important information and features from images to effectively classify and screen the images, thereby achieving screening and filtering of non-compliant images on the network.

[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present invention is to provide an image recognition method, device, equipment and storage medium, aiming to solve the technical problem of low image recognition accuracy in the prior art.

[0006] To achieve the above object, the present invention provides an image recognition method, which comprises the following steps:

[0007] Acquire images to be identified, and perform normalization processing on each image in the images to be identified to obtain a normalized image set;

[0008] Determining a normalized matrix corresponding to the image to be identified according to the normalized image set;

[0009] Determining the category label of each image in the to-be-recognized images according to the normalized matrix and the pre-trained convolutional neural network model;

[0010] Each image in the to-be-recognized images is marked according to the category label of each image, so as to complete the recognition of the to-be-recognized images.

[0011] Optionally, before acquiring the images to be identified and performing normalization processing on each image in the images to be identified to obtain a normalized image set, the method further includes:

[0012] Acquire original images, and divide the original images into a training image set and a test image set;

[0013] Training an initial convolutional neural network model based on the training image set;

[0014] When the training error of the initial convolutional neural network model converges, obtaining an error-converged convolutional neural network model;

[0015] Determining a test error according to the test image set and the error convergence convolutional neural network model;

[0016] When the test error is less than or equal to a preset error, acquiring a labeled image;

[0017] Determining a prediction accuracy of the labeled image according to the labeled image and the error convergence convolutional neural network model;

[0018] Determining whether the prediction accuracy is less than a preset accuracy;

[0019] If the prediction accuracy is not less than the preset accuracy, the error convergence convolutional neural network model is used as a pre-trained convolutional neural network model.

[0020] Optionally, after determining whether the prediction accuracy is less than a preset accuracy, the method further includes:

[0021] If the prediction accuracy is less than a preset accuracy, obtaining an image with prediction errors among the labeled images;

[0022] The image with incorrect prediction is taken as the original image, and the steps of obtaining the original image and dividing the original image into a training image and a test image are returned to execute, and the error convergence convolutional neural network model when the prediction accuracy is greater than or equal to the preset accuracy is taken as the pre-trained convolutional neural network model.

[0023] Optionally, determining a normalized matrix corresponding to the image to be identified according to the normalized image set includes:

[0024] Resizing each normalized image in the normalized image set to obtain a normalized reconstructed image set;

[0025] A normalized matrix corresponding to the image to be identified is determined according to the normalized reconstructed image set.

[0026] Optionally, determining the category label of each image in the to-be-recognized images according to the normalized matrix and a pre-trained convolutional neural network model includes:

[0027] Inputting the normalized matrix into a pre-trained convolutional neural network model so that the pre-trained convolutional neural network model performs batch classification on the normalized matrix;

[0028] When the batch classification is completed, the category label of each image in the to-be-identified image is obtained.

[0029] Optionally, the step of marking each image in the to-be-recognized images according to the category label of each image to complete the recognition of the to-be-recognized images includes:

[0030] Marking each image in the to-be-identified images according to the category label of each image;

[0031] The marked images are stored in a database to complete the recognition of the image to be recognized.

[0032] Optionally, dividing the original image into a training image and a test image includes:

[0033] The original image is divided into a training image and a test image according to a preset ratio.

[0034] In addition, to achieve the above object, the present invention also provides an image recognition device, the device comprising:

[0035] An acquisition module, used for acquiring images to be identified, and performing normalization processing on each image in the images to be identified to obtain a normalized image set;

[0036] A determination module, used to determine a normalized matrix corresponding to the image to be identified according to the normalized image set;

[0037] A category label determination module, used to determine the category label of each image in the to-be-identified images according to the normalized matrix and the pre-trained convolutional neural network model;

[0038] The marking module is used to mark each image in the to-be-recognized images according to the category label of each image, so as to complete the recognition of the to-be-recognized images.

[0039] In addition, to achieve the above-mentioned purpose, the present invention also proposes an image recognition device, which includes: a memory, a processor, and an image recognition program stored in the memory and executable on the processor, wherein the image recognition program is configured to implement the steps of the image recognition method described above.

[0040] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which an image recognition program is stored, and when the image recognition program is executed by a processor, the steps of the image recognition method described above are implemented.

[0041] The present invention obtains an image to be identified, and normalizes each image in the image to be identified to obtain a normalized image set; determines a normalized matrix corresponding to the image to be identified according to the normalized image set; determines a category label of each image in the image to be identified according to the normalized matrix and a pre-trained convolutional neural network model; marks each image in the image to be identified according to the category label of each image, and completes the identification of the image to be identified. Since the present invention normalizes the images in the image to be identified, determines the normalized matrix corresponding to the image to be identified according to the normalized image, determines the image label according to the normalized matrix and a pre-trained convolutional neural network, and marks each image according to the image label, thereby completing the identification of the image to be identified, the technical problem of high misjudgment rate when identifying a large amount of image data in the prior art is solved, and the accuracy of image recognition is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a structural diagram of an image recognition device in a hardware operating environment involved in an embodiment of the present invention;

[0043] Figure 2 A schematic diagram of a flow chart of a first embodiment of an image recognition method of the present invention;

[0044] Figure 3 It is a flowchart of a second embodiment of the image recognition method of the present invention;

[0045] Figure 4 A schematic diagram of a flow chart of a third embodiment of an image recognition method according to the present invention;

[0046] Figure 5 FIG. 4 is a structural block diagram of the first embodiment of the image recognition device of the present invention.

[0047] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0049] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the structure of an image recognition device in the hardware operating environment involved in the embodiment of the present invention.

[0050] like Figure 1As shown, the image recognition device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0051] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the image recognition device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0052] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module and an image recognition program.

[0053] exist Figure 1 In the image recognition device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the image recognition device of the present invention can be set in the image recognition device, and the image recognition device calls the image recognition program stored in the memory 1005 through the processor 1001, and executes the image recognition method provided by the embodiment of the present invention.

[0054] The embodiment of the present invention provides an image recognition method, referring to Figure 2 , Figure 2 FIG. 4 is a flow chart of the first embodiment of the image recognition method of the present invention.

[0055] In this embodiment, the image recognition method includes the following steps:

[0056] Step S10: Acquire images to be identified, and perform normalization processing on each image in the images to be identified to obtain a normalized image set.

[0057] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone or a host computer, or an electronic device capable of realizing the above functions, an image recognition device, etc. The following takes the image recognition device as an example to illustrate this embodiment and the following embodiments, which does not constitute a limitation on this embodiment.

[0058] It can be understood that the image to be identified is an unidentified image uploaded by a user, and the image to be identified includes several images, and the image to be identified includes at least one of a legal image and an illegal image.

[0059] It should be understood that each pixel of an image can be represented by three primary color components: red, green and blue. The normalization process is to calculate the average values ​​of the red, green and blue components of each pixel of the image, respectively, and then subtract the above average values ​​from the values ​​of the red, green and blue components of each pixel and divide them by the variance corresponding to the color of each pixel. After the image is normalized, a normalized image corresponding to the image is obtained. The normalized images corresponding to each image constitute a normalized image set.

[0060] Step S20: determining a normalized matrix corresponding to the image to be identified according to the normalized image set.

[0061] It can be understood that the normalized images in the normalized image set are subjected to image size reconstruction processing. After the size reconstruction processing, the normalized images can be processed into normalized images with uniform size. A matrix of a preset size can be randomly cropped from the normalized images with uniform size. The size of the matrix can be set according to the specific scenario. After the above processing is performed on each image in the normalized image set, the processed normalized images are merged to obtain the normalized matrix corresponding to the image to be identified.

[0062] Step S30: Determine the category label of each image in the to-be-recognized images according to the normalized matrix and the pre-trained convolutional neural network model.

[0063] It should be understood that the category label is a label that can distinguish the category of the image to be identified according to the set standard. The pre-trained convolutional neural network model is a convolutional neural network model that meets the use standards after training and testing. The normalized matrix is ​​input into the pre-trained convolutional neural network model, and the pre-trained convolutional neural network model recognizes it to obtain the category labels of each normalized image corresponding to the normalized matrix.

[0064] Step S40: marking each image in the to-be-recognized images according to the category label of each image, and completing the recognition of the to-be-recognized images.

[0065] It can be understood that each image has a category label, and the category label and the image type are one-to-one corresponding. According to the category label, the image can be marked as different pictures, such as legal pictures and illegal pictures, color pictures and black and white pictures, etc. The specific category label can be determined according to the specific usage scenario, and this embodiment does not limit this.

[0066] In the specific implementation, for example: various images to be processed uploaded by users to the server are obtained, images in the images to be processed are processed through a third-party Python library, images in the images to be processed are converted from UINT8 integer data to FLOAT32 floating-point data ranging from 0 to 1, and the color mean and variance of the images in the images to be processed are used for normalization to obtain a normalized image set, and the size of the normalized images in the normalized image set is reconstructed to a uniform size of 256*256, and a matrix of 224*224 is randomly cropped from each reconstructed normalized image, and all the normalized images processed as above are merged into a four-dimensional floating-point matrix. If there are 32 images in the images to be processed , then the size of the four-dimensional floating-point matrix can be expressed as 32*3*224*224, and the four-dimensional floating-point matrix is ​​a normalized matrix. The normalized matrix is ​​input into a pre-trained convolutional neural network model, and the pre-trained convolutional neural network model can be a pre-trained RESNEXT50 convolutional neural network model. The model processes the input data to obtain the category label of each image in the image to be identified. The category label can be represented by 0 and 1. According to the category label of each image, the image with the category label of 1 can be marked as an illegal image, and the image with the category label of 0 can be marked as a legal image, thereby completing the image recognition of the image to be identified. The above example is for the purpose of more clearly illustrating the present embodiment and does not constitute a limitation to the present embodiment.

[0067] Furthermore, in order to more accurately obtain the category label of each image, the step S30 includes: inputting the normalized matrix into a pre-trained convolutional neural network model so that the pre-trained convolutional neural network model performs batch classification on the normalized matrix; when the batch classification is completed, obtaining the category label of each image in the image to be identified.

[0068] It can be understood that the normalized matrix corresponding to the image to be identified is input into the pre-trained convolutional neural network model, and the pre-trained convolutional neural network model performs batch classification on the input normalized matrix. The batch classification is to batch label the input normalized matrix and classify it, wherein the batch classification can be batch binary classification, that is, the input normalized matrix data is divided into two categories, one category can be represented by 1, and the other category can be represented by 0. After the above processing, each image will be given a category label, for example, category label 1 represents an illegal picture, and category label 0 represents a legal picture. Other symbols can also be used to represent category labels, such as letters, symbols, etc., which are not limited in this embodiment.

[0069] Furthermore, in order to improve the efficiency of image recognition, the step S40 includes: marking each image in the to-be-recognized images according to the category label of each image; storing each marked image into a database to complete the recognition of the to-be-recognized images.

[0070] It can be understood that marking is the process of marking an image as a specific image according to its label category. For example, if the label category of an image is 1, then the image is marked as an illegal image; if the label category of an image is 0, then the image is marked as a legal image. Each image in the image data to be processed is marked, and the marked images are stored in the database to complete the identification of the image to be identified.

[0071] This embodiment obtains an image to be recognized, and normalizes each image in the image to be recognized to obtain a normalized image set; determines a normalized matrix corresponding to the image to be recognized according to the normalized image set; determines a category label of each image in the image to be recognized according to the normalized matrix and a pre-trained convolutional neural network model; marks each image in the image to be recognized according to the category label of each image, and completes image recognition of the image to be recognized. Since this embodiment normalizes the images in the image to be recognized, determines a normalized matrix corresponding to the image to be recognized according to the normalized image, determines an image label according to the normalized matrix and a pre-trained convolutional neural network, and marks each image according to the image label, image recognition of the image to be recognized is completed, which solves the technical problem of high misjudgment rate when recognizing a large number of images in the prior art and improves the accuracy of image recognition.

[0072] refer to Figure 3 , Figure 3 FIG. 4 is a flow chart of a second embodiment of an image recognition method according to the present invention.

[0073] Based on the first embodiment above, in this embodiment, before step S10, the method further includes:

[0074] Step S01: Acquire original images, and divide the original images into a training image set and a test image set.

[0075] It should be understood that the original images are images selected for training and testing the initial convolutional neural network model. The original images may be a certain number of legal images and illegal images collected from the network. During the collection process, the ratio of legal images to illegal images in the original images can be controlled to remain balanced to achieve better training and testing effects.

[0076] It should be understood that the training image set is an image set used to train the initial convolutional neural network, and the test image set is an image set used to test the accuracy of the trained initial convolutional neural network.

[0077] Step S02: training an initial convolutional neural network model according to the training image set.

[0078] It should be understood that the training image set is input into the initial convolutional neural network model, and the initial convolutional neural network model is trained and parameter optimized.

[0079] Step S03: When the training error of the initial convolutional neural network model converges, an error-converged convolutional neural network model is obtained.

[0080] It can be understood that during the training process of the initial convolutional neural network model, when the value of the error function of the initial convolutional neural network model is less than the preset error value, the training error of the initial convolutional neural network model converges. At this stage, the training of the model is completed, and an error-converged convolutional neural network model is obtained.

[0081] Step S04: determining a test error according to the test image set and the error convergence convolutional neural network model.

[0082] It can be understood that by inputting the test image set into the error convergence convolutional neural network model, the category label of each image in the test image set can be obtained after processing by the error convergence convolutional neural network model, and the above-mentioned images with category labels are reviewed, and the pictures with incorrect category labels marked by the error convergence convolutional neural network are marked out, and then the test error of the error convergence convolutional neural network can be obtained based on the total number of images in the test image data.

[0083] Step S05: when the test error is less than or equal to a preset error, obtaining labeled image data.

[0084] It should be understood that when the test error of the error convergence convolutional neural network model is less than or equal to the preset error, labeled image data is obtained. The labeled image data may be data with image labels that have been manually screened and labeled, that is, each image in the image data is manually reviewed and marked with an image label, for example, marked as a legal image or an illegal image.

[0085] It can be understood that when the test error is greater than the preset error, new original image data can continue to be acquired and the convolutional neural network model can be trained and tested until the test error is less than or equal to the preset error.

[0086] Step S06: Determine the prediction accuracy of the labeled image according to the labeled image and the error convergence convolutional neural network model.

[0087] It should be understood that the labeled image is input into the error convergence convolutional neural network, the error convergence convolutional neural network model processes the input labeled image, and marks the input labeled image with an image label, and the prediction accuracy of the error convergence convolutional neural network model is determined according to the labeled labeled image input to the error convergence convolutional neural network model and the category label of the image data output by the error convergence convolutional neural network model. For example: there are 100 labeled images in the labeled image data. After being processed by the error convergence convolutional neural network model, the category labels of 5 images are inconsistent with the original labels, and the prediction accuracy is 95%.

[0088] Step S07: Determine whether the prediction accuracy is less than a preset accuracy.

[0089] It should be understood that the preset accuracy is a pre-set accuracy that meets the current usage scenario. Different usage scenarios have different requirements for the accuracy of the model. In this embodiment, the preset accuracy can be set according to the specific usage scenario.

[0090] Step S08: If the prediction accuracy is not less than the preset accuracy, the error convergence convolutional neural network model is used as a pre-trained convolutional neural network model.

[0091] It can be understood that if the preset accuracy is not less than the preset accuracy, it means that the error convergence convolutional neural network model meets the current usage scenario, and this error convergence convolutional neural network model is used online as a pre-trained convolutional neural network model.

[0092] Furthermore, in order to improve the accuracy of image recognition, after step S07, the method also includes: if the prediction accuracy is less than a preset accuracy, obtaining an image with prediction errors in the labeled image; using the image with prediction errors as the original image, and returning to execute the steps of obtaining the original image and dividing the original image into a training image set and a test image set, and using the error convergence convolutional neural network model when the prediction accuracy is greater than or equal to the preset accuracy as the pre-trained convolutional neural network model.

[0093] It should be understood that if the prediction accuracy is less than the preset accuracy, it indicates that the model cannot meet the current usage scenario. At this time, the images with prediction errors in the labeled images are collected, and the steps of obtaining the original images and dividing the original images into a training image set and a test image set are returned to perform iterative training on the initial convolutional neural network model until the prediction accuracy of the error convergence convolutional neural network model is greater than or equal to the preset accuracy. At this time, the corresponding error convergence convolutional neural network model is put into use as a pre-trained convolutional neural network model.

[0094] It can be understood that in order to save model training time and improve model training efficiency, if the prediction accuracy is less than the preset accuracy, the images with incorrect predictions in the labeled images are obtained, and the images with incorrect predictions are divided into a training image set and a test image set. The most recently obtained error-converged convolutional neural network model is used as the initial convolutional neural network model for iterative training until the prediction accuracy is greater than or equal to the preset accuracy. The corresponding error-converged convolutional neural network model is put into use as the pre-trained convolutional neural network model.

[0095] Furthermore, in order to improve the accuracy of image recognition, the dividing the original image into a training image set and a test image set includes: dividing the original image set into a training image set and a test image set according to a preset ratio.

[0096] It should be understood that the preset ratio can be determined according to the specific application scenario. For example, if the preset ratio is 10:1, the ratio of the training image set and the test image set in the original image set is divided into 10:1. It can also be set to other ratios according to the specific application scenario.

[0097] This embodiment divides the original image into a training image set and a test image set. When the error of the initial convolutional neural network model converges after training with training image data, the test error of the error-convergent convolutional neural network is determined according to the test image set. When the test error is less than or equal to the preset error, the prediction accuracy of the error-convergent convolutional neural network model is tested with a labeled image. When the prediction accuracy is greater than or equal to the preset accuracy, the error-convergent convolutional neural network model is put into use as a pre-trained convolutional neural network model. When the prediction accuracy is less than the preset accuracy, the error-convergent convolutional neural network model is iteratively trained with an image with prediction error. This solves the technical problem of low model image recognition accuracy in the prior art and improves model training efficiency and image recognition accuracy.

[0098] refer to Figure 4 , Figure 4 FIG. 4 is a flow chart of a third embodiment of an image recognition method according to the present invention.

[0099] Based on the above embodiments, in this embodiment, step S20 includes:

[0100] Step S201: resize each normalized image in the normalized image set to obtain a normalized reconstructed image set.

[0101] It should be understood that after resizing each normalized image in the normalized image set, the images in the normalized image set have a uniform size, and a normalized reconstructed image set is obtained. For example, the images in the normalized image set can be reconstructed into a size of 256*256.

[0102] Step S202: determining a normalized matrix corresponding to the image to be identified according to the normalized reconstructed image set.

[0103] It should be understood that a matrix of a preset size is randomly cropped from the planned reconstructed images in the normalized reconstructed image set, and after all normalized reconstructed images are processed, the processed images are merged into a four-dimensional floating-point matrix, which is the normalized matrix.

[0104] This embodiment resizes the normalized image, crops the resized image, and finally merges them into a four-dimensional floating-point matrix, thereby improving the efficiency of image recognition.

[0105] In addition, an embodiment of the present invention further provides a storage medium, on which an image recognition program is stored. When the image recognition program is executed by a processor, the steps of the image recognition method described above are implemented.

[0106] Reference Figure 5 , Figure 5FIG. 4 is a structural block diagram of the first embodiment of the image recognition device of the present invention.

[0107] like Figure 5 As shown, the image recognition device proposed in the embodiment of the present invention includes: an acquisition module 10 , a determination module 20 , a category label determination module 30 and a marking module 40 .

[0108] An acquisition module 10 is used to acquire images to be identified, and perform normalization processing on each image in the images to be identified to obtain a normalized image set;

[0109] A determination module 20, configured to determine a normalized matrix corresponding to the image to be identified according to the normalized image set;

[0110] A category label determination module 30, used to determine the category label of each image in the to-be-identified images according to the normalized matrix and the pre-trained convolutional neural network model;

[0111] The marking module 40 is used to mark each image in the to-be-recognized images according to the category label of each image, so as to complete the recognition of the to-be-recognized images.

[0112] In this embodiment, the image to be identified is acquired by the acquisition module 10, and each image in the image to be identified is normalized to obtain a normalized image set; the determination module 20 determines the normalized matrix corresponding to the image to be identified according to the normalized image set; the category label determination module 30 determines the category label of each image in the image to be identified according to the normalized matrix and a pre-trained convolutional neural network model; the marking module 40 marks each image in the image to be identified according to the category label of each image to complete the identification of the image to be identified. Since this embodiment normalizes the images in the image to be identified, determines the normalized matrix corresponding to the image to be identified according to the normalized image, determines the image label according to the normalized matrix and a pre-trained convolutional neural network, and marks each image according to the image label, the identification of the image to be identified is completed, which solves the technical problem of high misjudgment rate when identifying a large number of images in the prior art and improves the accuracy of image recognition.

[0113] Based on the above-mentioned first embodiment of the image recognition device of the present invention, a second embodiment of the image recognition device of the present invention is proposed.

[0114] In this embodiment, the acquisition module 10 is also used to acquire the original image and divide the original image into a training image set and a test image set; train the initial convolutional neural network model according to the training image set; when the training error of the initial convolutional neural network model converges, obtain the error convergence convolutional neural network model; determine the test error according to the test image set and the error convergence convolutional neural network model; when the test error is less than or equal to the preset error, acquire a labeled image; determine the prediction accuracy of the labeled image according to the labeled image and the error convergence convolutional neural network model; judge whether the prediction accuracy is less than the preset accuracy; if the prediction accuracy is not less than the preset accuracy, use the error convergence convolutional neural network model as a pre-trained convolutional neural network model.

[0115] The acquisition module 10 is also used to acquire an image with incorrect prediction in the labeled image if the prediction accuracy is less than a preset accuracy; use the image with incorrect prediction as the original image, return to execute the steps of acquiring the original image, and divide the original image into a training image and a test image, and use the error convergence convolutional neural network model when the prediction accuracy is greater than or equal to the preset accuracy as the pre-trained convolutional neural network model.

[0116] The determination module 20 is further configured to resize each normalized image in the normalized image set to obtain a normalized reconstructed image set; and determine a normalized matrix corresponding to the image to be identified based on the normalized reconstructed image set.

[0117] The category label determination module 30 is also used to input the normalized matrix into a pre-trained convolutional neural network model so that the pre-trained convolutional neural network model performs batch classification on the normalized matrix; when the batch classification is completed, the category label of each image in the image to be identified is obtained.

[0118] The marking module 40 is further used to mark each image in the to-be-recognized images according to the category label of each image; store each marked image into a database, and complete the recognition of the to-be-recognized images.

[0119] The acquisition module 10 is further used to divide the original image into a training image and a test image according to a preset ratio.

[0120] Other embodiments or specific implementations of the image recognition device of the present invention may refer to the above-mentioned method embodiments and will not be described in detail here.

[0121] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0122] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0123] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0124] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. An image recognition method, characterized in that: The method comprises: Acquire images to be identified, and perform normalization processing on each image in the images to be identified to obtain a normalized image set; Determining a normalized matrix corresponding to the image to be identified according to the normalized image set; Determining a category label of each image in the to-be-identified images according to the normalized matrix and the pre-trained convolutional neural network model, wherein the image categories include legal images and illegal images; Marking each image in the to-be-identified images according to a category label of each image, wherein the category label is 1 or 0; Storing the marked images in a database to complete the recognition of the image to be recognized; Wherein, determining the normalized matrix corresponding to the image to be identified according to the normalized image set includes: Resizing each normalized image in the normalized image set to obtain a normalized reconstructed image set; Performing random cropping processing on each of the normalized reconstructed images in the normalized reconstructed image set, wherein the random cropping processing is to randomly crop a matrix of a preset size from each of the normalized reconstructed images; Merging the normalized reconstructed images after random cropping to obtain a normalized matrix corresponding to the image to be identified, wherein the normalized matrix is ​​a four-dimensional floating-point matrix; Wherein, determining the category label of each image in the to-be-identified images according to the normalized matrix and the pre-trained convolutional neural network model includes: Inputting the normalized matrix into a pre-trained convolutional neural network model, so that the pre-trained convolutional neural network model performs batch classification on the normalized matrix, wherein the batch classification is batch binary classification; When the batch classification is completed, obtaining a category label of each image in the to-be-identified images; The normalization step includes: Calculating the average values ​​of the three primary color components of each pixel of each of the images respectively; The values ​​of the three primary color components of each pixel are respectively subtracted from the corresponding average values, and the obtained differences are divided by the color corresponding variance of each pixel to obtain a normalized image corresponding to each image.

2. The method according to claim 1, characterized in that Before acquiring the images to be identified and performing normalization processing on each image in the images to be identified to obtain a normalized image set, the method further includes: Acquire original images, and divide the original images into a training image set and a test image set; Training an initial convolutional neural network model based on the training image set; When the training error of the initial convolutional neural network model converges, obtaining an error-converged convolutional neural network model; Determining a test error according to the test image set and the error convergence convolutional neural network model; When the test error is less than or equal to a preset error, acquiring a labeled image; Determining a prediction accuracy of the labeled image according to the labeled image and the error convergence convolutional neural network model; Determining whether the prediction accuracy is less than a preset accuracy; If the prediction accuracy is not less than the preset accuracy, the error convergence convolutional neural network model is used as a pre-trained convolutional neural network model.

3. The method according to claim 2, characterized in that After determining whether the prediction accuracy is less than a preset accuracy, the method further includes: If the prediction accuracy is less than a preset accuracy, obtaining an image with prediction errors among the labeled images; The image with incorrect prediction is taken as the original image, and the steps of obtaining the original image and dividing the original image into a training image and a test image are returned to execute, and the error convergence convolutional neural network model when the prediction accuracy is greater than or equal to the preset accuracy is taken as the pre-trained convolutional neural network model.

4. The method according to claim 3, characterized in that The dividing the original image into a training image and a test image comprises: The original image is divided into a training image and a test image according to a preset ratio.

5. An image recognition device, characterized in that: The device comprises: An acquisition module, used for acquiring images to be identified, and performing normalization processing on each image in the images to be identified to obtain a normalized image set; The normalization step includes: Calculating the average values ​​of the three primary color components of each pixel of each of the images respectively; Differences are calculated between the values ​​of the three primary color components of each pixel and the corresponding average values, and the obtained differences are divided by the color corresponding variance of each pixel to obtain a normalized image determination module corresponding to each image, which is used to determine the normalized matrix corresponding to the image to be identified according to the normalized image set; A category label determination module, used to determine the category label of each image in the to-be-identified images according to the normalized matrix and the pre-trained convolutional neural network model, wherein the image categories include legal images and illegal images; A marking module is used to mark each image in the to-be-recognized image according to the category label of each image, wherein the category label is 1 or 0; and store each marked image in a database to complete the recognition of the to-be-recognized image; The determination module is further used to resize each normalized image in the normalized image set to obtain a normalized reconstructed image set; perform random cropping processing on each normalized reconstructed image in the normalized reconstructed image set, wherein the random cropping processing is to randomly crop a matrix of a preset size from each normalized reconstructed image; and obtain a normalized matrix corresponding to the image to be identified by merging each normalized reconstructed image after the random cropping processing, wherein the normalized matrix is ​​a four-dimensional floating point matrix; The category label determination module is also used to input the normalized matrix into a pre-trained convolutional neural network model so that the pre-trained convolutional neural network model performs batch classification on the normalized matrix, and the batch classification is batch binary classification; when the batch classification is completed, the category label of each image in the image to be identified is obtained.

6. An image recognition device, characterized in that: The device comprises: a memory, a processor, and an image recognition program stored in the memory and executable on the processor, wherein the image recognition program is configured to implement the steps of the image recognition method according to any one of claims 1 to 4.

7. A storage medium, characterized in that: The storage medium stores an image recognition program, and when the image recognition program is executed by the processor, the steps of the image recognition method according to any one of claims 1 to 4 are implemented.