Image recognition method, device and equipment
By classifying and sparsely recombining the image data to be identified in the neural network, the problem of inefficiency caused by sparseness and irregular data sets is solved, and more efficient image recognition processing is achieved.
Patent Information
- Application Number
- CN202210700757.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-20
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2042-06-20
AI Technical Summary
Existing neural networks have inefficient computing due to sparseness and irregular data sets during image recognition, which requires a lot of time and resources to process.
By classifying the image data to be identified, redundant data are eliminated, and beneficial data are sparsely reorganized, making its form more regular and improving the computing efficiency of the neural network.
Effectively reduce the computing resource usage of neural networks, improve the operation efficiency of neural networks, and improve the computing speed of image recognition.
Smart Images

Figure CN114926697B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of artificial intelligence, and to an image recognition method, device and equipment. Background Art
[0002] Image recognition is a core branch of computer vision technology, which integrates knowledge of digital image processing, pattern recognition, and machine learning. In the current image recognition technology, neural network technology is usually used to realize feature recognition of the image to be recognized.
[0003] In the current neural network structure, each neural network consists of a convolutional layer, a pooling layer, a normalization layer, and a fully connected layer. Each layer of the neural network processes and calculates the data information of the image to be recognized and passes it to the next layer. Finally, it compares the data corresponding to the pre-stored recognition information to complete the image recognition task.
[0004] In the neural network calculation process, the data set calculated by the upper neural network structure usually contains 0 data, and the 0 data does not have actual physical meaning, which leads to a certain sparsity in the data set received by the lower neural network structure from the upper neural network. Since the synapses between neurons usually have independent weights, these sparsity data sets are irregularly transmitted in form. When faced with irregularly transmitted sparsity data sets, neural networks usually need to spend a lot of time and resources to process, which seriously affects the calculation efficiency. Summary of the invention
[0005] The embodiments of the present application provide an image recognition method, apparatus and device to solve the problem that the existing neural network performs image recognition with sparse and irregular data sets, resulting in low neural network calculation efficiency.
[0006] In a first aspect, an embodiment of the present application provides an image recognition method, the method comprising:
[0007] Acquire a data set of images to be identified, wherein the data set of images to be identified includes at least one piece of image data to be identified;
[0008] Classifying the at least one piece of image data to be identified to obtain at least one of the following classified data sets, including: a first category data set, a second category data set, and a third category data set, wherein the first category data corresponds to at least one piece of 0 data, the second category data set corresponds to at least one piece of data that is not 0 and is not within a preset threshold, and the third category data set corresponds to at least one piece of useful data;
[0009] According to a preset rule, sparsely reorganize the at least one useful data to obtain at least one input data set, each input data set including at least one useful data set;
[0010] The at least one input data set is computationally processed to obtain at least one recognition data set, where the recognition data set is used to characterize the image recognition result.
[0011] In some possible implementations, after obtaining the first category data set and the second category data set, the method further includes: removing the at least one 0 data and the at least one non-zero data that is not within a preset threshold. In this way, removing redundant data in the neural network can avoid invalid operations of the neural network to a certain extent, and improve the efficiency of neural network data calculation.
[0012] In some possible implementations, the sparsely reorganizing the at least one useful data according to a preset rule includes:
[0013] Acquire at least one piece of beneficial data, wherein the beneficial data includes: data that can be input into a lower-layer neural network for calculation and a neural network weight parameter corresponding to each piece of beneficial data;
[0014] Performing sparse reorganization on the at least one useful data to obtain a quasi-input data set,
[0015] If the amount of useful data in the quasi-input data set is greater than the number of convolution kernels of the lower-layer neural network, the quasi-input data set is equally divided to obtain at least two quasi-input data subsets, and each of the at least two quasi-input data subsets is used as the input data set;
[0016] If the number of useful data in the quasi-input data set is less than or equal to the number of convolution kernels of the lower neural network, the quasi-input data set is used as the input data set. In this way, by reorganizing the useful data after removing redundant data, the form of useful data before inputting into the lower neural network structure is regularized, which is beneficial to the recognition and calculation of the neural network structure of the lower layer, thereby improving the calculation efficiency of the neural network.
[0017] In some possible implementations, performing computational processing on the at least one input data set includes:
[0018] Obtaining a computational amount of all beneficial data corresponding to each input data set of the at least one input data set;
[0019] According to the computational amount of all the beneficial data corresponding to the at least one input data set, a corresponding multiplication accumulator is selected for computation to obtain the at least one recognition data set. In this way, a multiplication accumulator with equivalent computational power can be matched to the beneficial data according to the computational amount, so that the computational resource allocation in the neural network is more reasonable.
[0020] In some possible implementations, the neural network weight parameters and the recognition data set are stored in a pre-deployed magnetic random access memory, and the magnetic random access memory is also used to implement the computational processing of the at least one input data set. In this way, the high-speed transmission and non-volatile characteristics of the magnetic random access memory are used to improve the computational speed of the neural network.
[0021] In some possible implementations, it is characterized in that the step of obtaining a dataset of images to be identified includes:
[0022] Acquire at least one image to be recognized, where the at least one image to be recognized is obtained by a pre-deployed image acquisition device;
[0023] Data is loaded for each of the at least one image to be identified to obtain image data to be identified corresponding to each image to be identified, and each image to be identified corresponds to at least one piece of image data to be identified.
[0024] In some possible implementations, the image data to be identified includes: image color coordinate information, image pixel position information, and image pixel quantity information.
[0025] In a second aspect, an embodiment of the present application further provides an image recognition device, the device comprising:
[0026] An acquisition module, used for acquiring a data set of images to be recognized, wherein the data set of images to be recognized includes at least one piece of image data to be recognized;
[0027] a classification module, classifying the at least one piece of image data to be identified, and obtaining at least one of the following classification data sets, including: a first category data set, a second category data set, and a third category data set, wherein the first category data corresponds to at least one piece of 0 data, the second category data set corresponds to at least one piece of non-0 data that is not within a preset threshold, and the third category data set corresponds to at least one piece of useful data;
[0028] A sparse reorganization module, which performs sparse reorganization on the at least one useful data according to a preset rule to obtain at least one input data set, each input data set including at least one useful data set;
[0029] The computing module performs computational processing on the at least one input data set to obtain at least one recognition data set, where the recognition data set is used to represent the image recognition result.
[0030] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method in the first aspect or any possible implementation manner of the first aspect by executing the computer instructions.
[0031] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the method in the first aspect or any possible implementation of the first aspect.
[0032] The embodiment of the present application provides an image recognition method. In this scheme, first, an image data set to be recognized is obtained, wherein the image data set to be recognized includes at least one image data to be recognized; then, the at least one image data to be recognized is classified to obtain at least one of the following classified data sets, including: a first category data set, a second category data set and a third category data set, wherein the first category data corresponds to at least one 0 data, the second category data set corresponds to at least one non-0 data that is not within a preset threshold, and the third category data set corresponds to at least one useful data; then, according to a preset rule, the at least one useful data is sparsely reorganized to obtain at least one input data set, each input data set includes at least one useful data; finally, each of the at least one useful data is calculated and processed to obtain at least one recognition data, and the recognition data is used to characterize the image recognition result. It can be seen that by classifying and screening the image data to be recognized, eliminating the 0 data that has no physical meaning and the non-zero data that is not within the preset threshold, and only using the useful data that can be used for subsequent neural network calculations for calculation and information transmission, the overall computing resource usage of the neural network can be effectively reduced. Furthermore, before inputting useful data into the lower layer, the useful data is sparsely reorganized to make it more regular in form, thereby improving the operating efficiency of the neural network. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a flowchart of a disease identification method based on text classification provided in an embodiment of the present application;
[0034] Figure 2a It is a schematic diagram of extracting useful data in the image recognition method provided in the embodiment of the present application;
[0035] Figure 2b It is a schematic diagram of irregular beneficial data in the image recognition method provided in an embodiment of the present application;
[0036] Figure 2cis a schematic diagram of a quasi-input data set in the image recognition method provided in an embodiment of the present application;
[0037] Figure 2d is a schematic diagram of a quasi-input subset in the image recognition method provided in an embodiment of the present application;
[0038] Figure 3 A schematic diagram of the structure of an image recognition device provided in an embodiment of the present application;
[0039] Figure 4 It is a schematic diagram of an exemplary structure of an image recognition device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The terms used in the following embodiments of the present application are for the purpose of describing optional implementation modes, and are not intended to be used as limitations to the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions. It should also be understood that although the terms first, second, etc. may be used to describe a certain class of objects in the following embodiments, the objects are not limited to these terms. These terms are used to distinguish the specific objects of this class of objects. For example, the same is true for other classes of objects that may be described using the terms first, second, etc. in the following embodiments, which will not be repeated here.
[0041] The embodiment of the present application provides an image recognition method. In this scheme, first, an image data set to be recognized is obtained, wherein the image data set to be recognized includes at least one image data to be recognized; then, the at least one image data to be recognized is classified to obtain at least one of the following classified data sets, including: a first category data set, a second category data set and a third category data set, wherein the first category data corresponds to at least one 0 data, the second category data set corresponds to at least one non-0 data that is not within a preset threshold, and the third category data set corresponds to at least one useful data; then, according to a preset rule, the at least one useful data is sparsely reorganized to obtain at least one input data set, each input data set includes at least one useful data; finally, each of the at least one useful data is calculated and processed to obtain at least one recognition data, and the recognition data is used to characterize the image recognition result. It can be seen that by classifying and screening the image data to be recognized, eliminating the 0 data that has no physical meaning and the non-zero data that is not within the preset threshold, and only using the useful data that can be used for subsequent neural network calculations for calculation and information transmission, the overall computing resource usage of the neural network can be effectively reduced. Furthermore, before inputting useful data into the lower layer, the useful data is sparsely reorganized to make it more regular in form, thereby improving the operating efficiency of the neural network.
[0042] Any electronic device involved in the embodiments of the present application may be an electronic device such as a mobile phone, a tablet computer, a wearable device (e.g., a smart watch, a smart bracelet, etc.), a laptop computer, a desktop computer, and a vehicle-mounted device. The electronic device is pre-installed with a software deployment application. It is understood that the embodiments of the present application do not impose any restrictions on the specific type of electronic device.
[0043] Image recognition is a core branch of computer vision technology, which integrates knowledge of digital image processing, pattern recognition, and machine learning. In the current image recognition technology, neural network technology is usually used to realize feature recognition of the image to be recognized.
[0044] In the current neural network structure, each neural network consists of a convolutional layer, a pooling layer, a normalization layer, and a fully connected layer. Each layer of the neural network processes and calculates the data information of the image to be recognized and passes it to the next layer. Finally, it compares the data corresponding to the pre-stored recognition information to complete the image recognition task.
[0045] In the neural network calculation process, the data set calculated by the upper neural network structure usually contains 0 data, and the 0 data does not have actual physical meaning, which leads to a certain sparsity in the data set received by the lower neural network structure from the upper neural network. Since the synapses between neurons usually have independent weights, these sparsity data sets are irregularly transmitted in form. When faced with irregularly transmitted sparsity data sets, neural networks usually need to spend a lot of time and resources to process, which seriously affects the calculation efficiency.
[0046] It is understandable that the technical solutions mentioned in this application are not only applicable to scenarios of image recognition, but also to scenarios such as image detection, target classification, video analysis, and natural language processing.
[0047] The following is a description of several exemplary implementations, illustrating the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application.
[0048] In the first aspect of the present application, an image recognition method is proposed, see Figure 1 , Figure 1 The image recognition method provided in the embodiment of the present application includes the following steps:
[0049] Acquire a data set of images to be identified, wherein the data set of images to be identified includes at least one piece of image data to be identified;
[0050] Classifying the at least one piece of image data to be identified to obtain at least one of the following classified data sets, including: a first category data set, a second category data set, and a third category data set, wherein the first category data corresponds to at least one piece of 0 data, the second category data set corresponds to at least one piece of data that is not 0 and is not within a preset threshold, and the third category data set corresponds to at least one piece of useful data;
[0051] According to a preset rule, sparsely reorganize the at least one useful data to obtain at least one input data set, each input data set including at least one useful data set;
[0052] The at least one input data set is computationally processed to obtain at least one recognition data set, where the recognition data set is used to characterize the image recognition result.
[0053] Exemplarily, taking the recognition of image data as an example, first, the acquired image data is sent to a preset neural network.
[0054] Then, the image data obtained by the neural network is classified. Usually, there are more 0 data in the initial image data, and these 0 data do not have actual physical meanings. In this way, a certain sparsity is brought to the image data obtained by the neural network. After the current neural network structure is calculated, the calculation results obtained can usually be classified into: 0 data without actual physical meaning, non-0 data that has actual physical meaning but cannot be applied by the lower neural network structure and is not within the preset threshold, and useful data that has actual physical meaning and can be applied by the lower neural network structure. According to the above data types, the image data obtained by the neural network is classified, and at least one of the following classified data can be obtained: a first category data set, a second category data set, and a third category data set. In this way, it is convenient to select useful data that can be applied to calculations for the lower neural network, thereby improving the calculation efficiency of the neural network.
[0055] Then, according to the pre-set rules, only the useful data is selected, and the useful data is sparsely reorganized and organized into an input data set, which is input into the lower neural network in the form of a data set. In this way, the structure of the useful data is more regular, which improves the calculation efficiency of the neural network.
[0056] Finally, the input data set is calculated, and the calculation result (i.e., the recognition data set) is compared and matched with the corresponding recognition result pre-stored in the system to obtain the matched recognition result and complete the recognition. In this way, image recognition can be completed accurately.
[0057] In a possible implementation manner, the image recognition method further includes:
[0058] After obtaining the first category data set and the second category data set, the method further includes: removing the at least one piece of 0 data and the at least one piece of non-0 data that is not within a preset threshold.
[0059] Exemplarily, after the neural network completes the classification of the image data to be identified, Figure 2a As shown, the data of the third category is extracted, and the data of the first category and the second category are eliminated. In this way, the data processing amount of the neural network can be reduced without affecting the final calculation result of the neural network, and the occupation of computing resources by redundant data can be reduced, thereby improving the computing efficiency of the neural network.
[0060] In a possible implementation manner, the sparsely reorganizing the at least one useful data according to a preset rule includes:
[0061] Acquire at least one piece of beneficial data, wherein the beneficial data includes: data that can be input into a lower-layer neural network for calculation and a neural network weight parameter corresponding to each piece of beneficial data;
[0062] Performing sparse reorganization on the at least one useful data to obtain a quasi-input data set,
[0063] If the amount of useful data in the quasi-input data set is greater than the number of convolution kernels of the lower-layer neural network, the quasi-input data set is equally divided to obtain at least two quasi-input data subsets, and each of the at least two quasi-input data subsets is used as the input data set;
[0064] If the amount of useful data in the quasi-input data set is less than or equal to the number of convolution kernels of the lower-layer neural network, the quasi-input data set is used as the input data set.
[0065] For example, in a neural network, since the synapses between neurons usually have dependent or independent weights, after extracting the third category of data and calculating it through the neural network, there is still a possibility that the useful data is distributed in an irregular form, as shown in the following example: Figure 2b As shown, the location of the useful data is not concentrated in the storage space, and there are empty locations where no information is stored. Therefore, it is necessary to perform sparse reorganization on the data to obtain a useful data set with regular form (i.e., quasi-input data set) for input into the lower neural network;
[0066] At least one useful data is sparsely reorganized to obtain a useful data set with regular form as a quasi-input data set, such as Figure 2c As shown, this can make the data calculation process more efficient;
[0067] Obviously, the computing power of the neural network is positively correlated with the number of pre-set convolution kernels. When the amount of useful data in the useful data set to be processed exceeds the computing power corresponding to the number of convolution kernels set for the current layer or the lower layer neural network, in order to ensure the normal operation of the neural network, the input data set needs to be split into equal parts. Figure 2c Taking the 10x10 quasi-input data set as an example, if the number of convolution kernels preset by the lower neural network can only process 7x7 useful data at most, the 10x10 quasi-input data set needs to be split. One example of splitting is as follows: Figure 2d As shown in the figure, the input data is divided into four 5×5 quasi-input subsets, and these four 5×5 quasi-input subsets will be used as input data sets to the lower neural network for calculation. In this way, by reorganizing the data after removing redundant data, the form of useful data before inputting into the lower neural network structure is regularized, which is beneficial to the recognition and calculation of the lower neural network structure, thereby improving the calculation efficiency of the neural network.
[0068] In a possible implementation, performing computational processing on the at least one input data set includes:
[0069] Obtaining a computational amount of all beneficial data corresponding to each input data set of the at least one input data set;
[0070] According to the computational amount of all beneficial data corresponding to the at least one input data set, a corresponding multiplication accumulator is selected to perform calculation to obtain the at least one identification data set.
[0071] Exemplarily, before the current layer neural network structure is calculated, the calculation amount of the input data in the input data set is obtained, and the most suitable multiplication accumulator is selected for calculation according to the pre-set multiplication accumulator selection rule corresponding to the calculation amount. In this way, the hardware computing resources in the neural network can be reasonably allocated to avoid the phenomenon of uneven distribution of computing resources.
[0072] In a possible implementation, the neural network weight parameters and the recognition data set are stored in a pre-deployed magnetic random access memory, and the magnetic random access memory is also used to implement the computational processing of the at least one input data set.
[0073] Exemplarily, the magnetic random access memory can be arranged near the computing unit or concentrated in one storage unit to reduce the overhead of data movement and realize near-memory computing. In terms of near-memory computing, the magnetic random access memory has the characteristics of high-speed transmission and data non-volatility. Here, the magnetic random access memory is combined with the near-memory computing technology to store weight data and the corresponding recognition data set to reduce the power overhead of the neural network and improve the data transmission rate.
[0074] Optionally, the stored neural network weights are transmitted to an internal pre-deployed computing module via a FIFO memory within the magnetic random access memory for computational processing.
[0075] Optionally, the magnetic random access memory may also store corresponding storage-only instructions, including: sparse reorganization processing instructions, statistical data quantity instructions, configurable multiplier accumulator instructions, and data transmission instructions.
[0076] Wherein, the reorganization processing instruction is used to implement sparse reorganization of the at least one piece of data shown;
[0077] The statistical data quantity instruction is used to implement the calculation quantity of all beneficial data corresponding to each input data set of the at least one input data set;
[0078] The configurable multiplier accumulator instruction is used to select a corresponding multiplier accumulator to perform calculations on the amount of calculation of all beneficial data corresponding to the at least one input data set;
[0079] The data transmission instruction is used to implement the data transmission action inside the neural network.
[0080] The embodiment of the present application provides an image recognition method. In this scheme, first, an image data set to be recognized is obtained, wherein the image data set to be recognized includes at least one image data to be recognized; then, the at least one image data to be recognized is classified to obtain at least one of the following classified data sets, including: a first category data set, a second category data set and a third category data set, wherein the first category data corresponds to at least one 0 data, the second category data set corresponds to at least one non-0 data that is not within a preset threshold, and the third category data set corresponds to at least one useful data; then, according to a preset rule, the at least one useful data is sparsely reorganized to obtain at least one input data set, each input data set includes at least one useful data; finally, each of the at least one useful data is calculated and processed to obtain at least one recognition data, and the recognition data is used to characterize the image recognition result. It can be seen that by classifying and screening the image data to be recognized, eliminating the 0 data that has no physical meaning and the non-zero data that is not within the preset threshold, and only using the useful data that can be used for subsequent neural network calculations for calculation and information transmission, the overall computing resource usage of the neural network can be effectively reduced. Furthermore, before inputting useful data into the lower layer, the useful data is sparsely reorganized to make it more regular in form, thereby improving the operating efficiency of the neural network.
[0081] For example, if the above implementation steps implement the corresponding functions through software modules. Figure 3As shown, the image recognition device may include an acquisition module, a classification module, a sparse recombination module and a calculation module. The image recognition device may be used to perform part or all of the operations of the above-mentioned image recognition method.
[0082] For example:
[0083] An acquisition module, used for acquiring a data set of images to be recognized, wherein the data set of images to be recognized includes at least one piece of image data to be recognized;
[0084] a classification module, classifying the at least one piece of image data to be identified, and obtaining at least one of the following classification data sets, including: a first category data set, a second category data set, and a third category data set, wherein the first category data corresponds to at least one piece of 0 data, the second category data set corresponds to at least one piece of non-0 data that is not within a preset threshold, and the third category data set corresponds to at least one piece of useful data;
[0085] A sparse reorganization module, which performs sparse reorganization on the at least one useful data according to a preset rule to obtain at least one input data set, each input data set including at least one useful data set;
[0086] The computing module performs computational processing on the at least one input data set to obtain at least one recognition data set, where the recognition data set is used to represent the image recognition result.
[0087] Optionally, the device also includes a first storage module, the storage module includes a magnetic memory, and the magnetic memory is used to store neural network weight parameters, identification data sets and corresponding instructions, and the corresponding instructions include: sparse reorganization processing instructions, statistical data quantity instructions, configurable multiplication accumulator instructions and data transmission instructions.
[0088] Wherein, the reorganization processing instruction is used to implement sparse reorganization of the at least one piece of data shown;
[0089] The statistical data quantity instruction is used to implement the calculation quantity of all beneficial data corresponding to each input data set of the at least one input data set;
[0090] The configurable multiplier accumulator instruction is used to select a corresponding multiplier accumulator to perform calculations on the amount of calculation of all beneficial data corresponding to the at least one input data set;
[0091] The data transmission instruction is used to implement the data transmission action inside the neural network.
[0092] Optionally, the image recognition device also includes a second storage module, which includes a dynamic random access memory. The dynamic random access memory is used to cache images or video information obtained by an external image acquisition device, and convert the image information into image data information by directly accessing the memory to a preset image calculation module.
[0093] Optionally, the image recognition device also includes a third storage module, which includes a static random access memory, and the static random access memory is connected to the magnetic random access memory in the first storage module through a system bus to form a hybrid storage structure. The third storage module is used to store internal data of the first storage module to improve the overall information reliability of the system.
[0094] It can be seen that the embodiment of the present application provides an image recognition method. In this scheme, first, an image data set to be recognized is obtained, and the image data set to be recognized includes at least one image data to be recognized; then, the at least one image data to be recognized is classified to obtain at least one of the following classified data sets, including: a first category data set, a second category data set and a third category data set, the first category data corresponds to at least one 0 data, the second category data set corresponds to at least one non-0 data that is not within a preset threshold, and the third category data set corresponds to at least one useful data; then, according to a preset rule, the at least one useful data is sparsely reorganized to obtain at least one input data set, each input data set includes at least one useful data; finally, each of the at least one useful data is calculated and processed to obtain at least one recognition data, and the recognition data is used to characterize the image recognition result. It can be seen that by classifying and screening the image data to be recognized, the 0 data that has no physical meaning and the non-zero data that is not within the preset threshold are eliminated, and only the useful data that can be used for subsequent neural network calculations are used for calculation and information transmission, which can effectively reduce the overall computing resource usage of the neural network. Furthermore, before inputting useful data into the lower layer, the useful data is sparsely reorganized to make it more regular in form, thereby improving the operating efficiency of the neural network.
[0095] It is understandable that the functions of the above modules can be integrated into hardware entities for implementation. For example, the acquisition module can be integrated into a transceiver for implementation, the classification module, the sparse reorganization module and the calculation module can be integrated into a processor for implementation, and the programs and instructions for implementing the functions of the above modules can be maintained in a memory. Figure 4As shown, an electronic device is provided, the electronic device includes a processor, a transceiver and a memory, wherein the transceiver is used to perform the acquisition of learning results corresponding to the target reference information and each of the coded information in the disease identification method based on multiple information, and the memory is used to store the program / code pre-installed in the above deployment device, and can also store the code for the processor to execute. When the processor runs the code stored in the memory, the electronic device performs part or all of the operations of the software deployment method in the above method.
[0096] The specific process is described in the embodiment of the above method and will not be described in detail here.
[0097] In a specific implementation, corresponding to the aforementioned electronic device, an embodiment of the present application further provides a computer storage medium, wherein the computer storage medium provided in the electronic device may store a program, and when the program is executed, some or all of the steps in each embodiment of the aforementioned software deployment method may be implemented. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0098] One or more of the above modules or units can be implemented by software, hardware or a combination of the two. When any of the above modules or units is implemented by software, the software exists in the form of computer program instructions and is stored in a memory, and the processor can be used to execute the program instructions and implement the above method flow. The processor may include but is not limited to at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor and other types of computing devices that run software, each of which may include one or more cores for executing software instructions to perform operations or processing. The processor may be built into an SoC (system on chip) or an application specific integrated circuit (ASIC), or it may be an independent semiconductor chip. In addition to the core used to execute software instructions for operations or processing in the processor, it may further include necessary hardware accelerators, such as field programmable gate arrays (FPGA), PLDs (programmable logic devices), or logic circuits that implement dedicated logic operations.
[0099] When the above modules or units are implemented in hardware, the hardware can be any one or any combination of a CPU, a microprocessor, a DSP, an MCU, an artificial intelligence processor, an ASIC, a SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator or a non-integrated discrete device, which can run the necessary software or not rely on the software to execute the above method flow.
[0100] Furthermore, Figure 3 The bus interface may also include a bus interface, which may include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by the processor and memory represented by the memory. The bus interface may also link various other circuits such as peripherals, voltage regulators, and power management circuits together, which are all well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver provides a unit for communicating with various other devices over a transmission medium. The processor is responsible for managing the bus architecture and general processing, and the memory may store data used by the processor when performing operations.
[0101] When the above modules or units are implemented using software, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0102] It should be understood that in various embodiments of the present application, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment.
[0103] Each part of this specification is described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment part.
[0104] Although the optional embodiments of the present application have been described, those skilled in the art, once informed of the basic creative concept, may make additional changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiment and all changes and modifications falling within the scope of the present application.
[0105] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the scope of protection of the present invention.
Claims
1. An image recognition method, characterized in that: The method comprises: Acquire a data set of images to be identified, wherein the data set of images to be identified includes at least one piece of image data to be identified; Classifying the at least one piece of image data to be identified to obtain at least one of the following classified data sets, including: a first category data set, a second category data set, and a third category data set, wherein the first category data corresponds to at least one piece of 0 data, the second category data set corresponds to at least one piece of data that is not 0 and is not within a preset threshold, and the third category data set corresponds to at least one piece of useful data; According to a preset rule, sparsely reorganize the at least one useful data to obtain at least one input data set, each input data set including at least one useful data set; The at least one input data set is processed by computation to obtain at least one recognition data set, where the recognition data set is used to represent the image recognition result. After obtaining the first category data set and the second category data set, the method further includes: removing the at least one piece of 0 data and the at least one piece of non-0 data that is not within a preset threshold, The step of performing sparse reorganization on the at least one useful data according to a preset rule includes: Acquire at least one piece of beneficial data, wherein the beneficial data includes: data that can be input into a lower-layer neural network for calculation and a neural network weight parameter corresponding to each piece of beneficial data; Performing sparse reorganization on the at least one useful data to obtain a quasi-input data set, If the amount of useful data in the quasi-input data set is greater than the number of convolution kernels of the lower-layer neural network, the quasi-input data set is equally divided to obtain at least two quasi-input data subsets, and each of the at least two quasi-input data subsets is used as the input data set; If the amount of useful data in the quasi-input data set is less than or equal to the number of convolution kernels of the lower-layer neural network, the quasi-input data set is used as the input data set.
2. The image recognition method according to claim 1, characterized in that: The at least one input data set is subjected to computational processing, comprising: Obtaining a computational amount of all beneficial data corresponding to each input data set of the at least one input data set; According to the computational amount of all beneficial data corresponding to the at least one input data set, a corresponding multiplication accumulator is selected to perform calculation to obtain the at least one identification data set.
3. The image recognition method according to claim 1, characterized in that: The neural network weight parameters and the recognition data set are stored in a pre-deployed magnetic random access memory, and the magnetic random access memory is also used to implement the computational processing of the at least one input data set.
4. The image recognition method according to claim 1, characterized in that: The step of obtaining a dataset of images to be identified includes: Acquire at least one image to be recognized, where the at least one image to be recognized is obtained by a pre-deployed image acquisition device; Data is loaded for each of the at least one image to be identified to obtain image data to be identified corresponding to each image to be identified, and each image to be identified corresponds to at least one piece of image data to be identified.
5. The image recognition method according to claim 4, characterized in that: The image data to be identified includes: image color coordinate information, image pixel position information and image pixel quantity information.
6. An image recognition device, characterized in that: The device comprises: An acquisition module, used for acquiring a data set of images to be recognized, wherein the data set of images to be recognized includes at least one piece of image data to be recognized; a classification module, classifying the at least one piece of image data to be identified, and obtaining at least one of the following classification data sets, including: a first category data set, a second category data set, and a third category data set, wherein the first category data corresponds to at least one piece of 0 data, the second category data set corresponds to at least one piece of non-0 data that is not within a preset threshold, and the third category data set corresponds to at least one piece of useful data; A sparse reorganization module, which performs sparse reorganization on the at least one useful data according to a preset rule to obtain at least one input data set, each input data set including at least one useful data set; a computing module, which performs computing processing on the at least one input data set to obtain at least one recognition data set, wherein the recognition data set is used to represent the image recognition result; After obtaining the first category data set and the second category data set, the method further includes: removing the at least one 0 data and the at least one non-0 data that is not within a preset threshold, The step of performing sparse reorganization on the at least one useful data according to a preset rule includes: Acquire at least one piece of beneficial data, wherein the beneficial data includes: data that can be input into a lower-layer neural network for calculation and a neural network weight parameter corresponding to each piece of beneficial data; Performing sparse reorganization on the at least one useful data to obtain a quasi-input data set, If the amount of useful data in the quasi-input data set is greater than the number of convolution kernels of the lower-layer neural network, the quasi-input data set is equally divided to obtain at least two quasi-input data subsets, and each of the at least two quasi-input data subsets is used as the input data set; If the amount of useful data in the quasi-input data set is less than or equal to the number of convolution kernels of the lower-layer neural network, the quasi-input data set is used as the input data set.
7. An electronic device, characterized in that: The electronic device comprises: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 5 by executing the computer instructions.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 5.
