Image recognition method and device
Through the improved capsule network architecture, combined with the geometric information of images and feature points, it solves the problem of difficult recognition of rotated or flipped objects by traditional convolutional neural networks, improves recognition accuracy and anti-spoofing capabilities, and achieves better image understanding. Effect.
Patent Information
- Application Number
- CN201911093467.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-11
- Publication Date
- 2024-08-13
- Estimated Expiration
- 2039-11-11
AI Technical Summary
Traditional convolutional neural networks have the problem of being unable to accurately identify the features of rotated or flipped objects in image recognition, and it is difficult to understand the geometric meaning of the image, resulting in insufficient recognition accuracy.
Using an improved capsule network architecture, the image and feature points are input into the convolutional layer and the main capsule layer. By generating feature vectors and activity vectors, the geometric information of the image is combined for recognition, thereby enhancing the understanding of the geometric meaning of the image.
It improves the accuracy and anti-spoofing ability of image recognition, can achieve better recognition results with smaller training samples, and improves the understanding of the geometric relationships of object details.
Smart Images

Figure CN112784652B_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to an image recognition method and device, and in particular to an image recognition method and device introducing capsule network technology. [Existing Technology]
[0002] Convolutional neural network (CNN) is the mainstream image recognition technology. It can extract local features through convolution operation, discard redundant features through pooling operation, and finally achieve the effect of identifying objects through a fully connected layer. Since the convolution operation can make full use of the local correlation of the image and reduce the number of parameters and complexity through weight sharing and pooling operations, it can achieve the value of replacing manual and commercialization in the field of recognition, and also announce the advent of the era of artificial intelligence.
[0003] The birth of capsule network comes from the success of CNN. Specifically, although the convolution and pooling operations of CNN have created a good feature extraction capability, it also creates an essential problem, namely "scalar in / scalar out". In this case, since the understanding of the object is only represented by pure quantity, the same object will become another set of features after being rotated or flipped. This may also cause many sets of features to be the same object, but the traditional neural network cannot detect it.
[0004] The capsule network has made a breakthrough improvement in the feature extraction method, namely "vector in / vector out". In the capsule network, the basic information and deformation information of the object can be recorded through a set of feature vectors, thereby essentially solving the problem of CNN that the same object will become different features after rotation or flipping.
[0005] The difference from traditional neural networks is that each neuron in the capsule network is composed of a capsule, and the goal of each capsule is to detect the characteristics of the target object. This characteristic can be converted into a vector through the output of each capsule, and the length and direction of this vector can have special meanings. For example, the length of the vector can represent the probability of the existence of the object detected by this capsule, and the direction of the vector can represent the characteristics of the detected object (such as: position, size, material, angle, etc.).
[0006] Similar to traditional neural networks, the above vector (a scalar in traditional neural networks) represents the features of lower-level objects, and higher-level neurons can detect the characteristics of higher-level objects through multiple lower-level object feature information. Similarly, this characteristic will also be converted into a vector to achieve the operation of neurons.
[0007] The difference from traditional neural networks is that the directionality of the feature vector of the low-level object may affect the existence probability of the high-level feature object. For example, two eyes perpendicular to each other cannot form a face.
[0008] The success of traditional neural networks is obvious to all, and their capabilities are far beyond human imagination in the past, but at the same time, they still have fundamental shortcomings. Specifically, for traditional neural networks, when eyes, nose, mouth and other parts appear in an image, the convolutional neural network will think that this is a face, no matter where these parts appear in the unreasonable position.
[0009] However, capsule networks are different. The lower-level capsules can retain the complete component characteristics (position, size, etc. of the facial features), while the higher-level capsules can detect whether it is a real, complete object (face) based on these characteristics.
[0010] While retaining the advantages of traditional neural networks, capsule networks also solve the fundamental shortcomings of traditional neural networks. This not only improves the performance of neural networks, but also solves some artificially added false images (such as images with misplaced facial features). Therefore, the application scope of capsule networks is very wide. Any work that current neural networks can do, capsule networks can also do, and even perform better.
[0011] Although capsules better preserve the geometric relationship of object details, the network architecture design does not really allow the neural network to effectively understand the geometric meaning of the object. Therefore, although it can have smaller training samples than CNN, the effect is still limited. [Summary of the invention]
[0012] In view of this, the present invention provides an image recognition method and device, which can be used to solve the above technical problems.
[0013] The present invention provides an image recognition method, comprising: obtaining an image and extracting a plurality of feature points in the image; obtaining a capsule network, wherein the capsule network sequentially comprises a convolution layer, a main capsule layer, at least one routing capsule layer and an output layer; inputting the image and the feature points into the convolution layer to generate a plurality of feature vectors; inputting the feature vectors and the feature points into the main capsule layer to generate a plurality of activity vectors; and generating a recognition result corresponding to the image based on the activity vectors by at least one routing capsule layer and the output layer.
[0014] The present invention provides an image recognition device, comprising a storage circuit and a processor. The storage circuit stores a plurality of modules. The processor is coupled to the storage circuit and accesses the modules to perform the following steps: obtaining an image and capturing a plurality of feature points in the image; obtaining a capsule network, wherein the capsule network sequentially comprises a convolution layer, a main capsule layer, at least one routing capsule layer and an output layer; inputting the image and the feature points into the convolution layer to generate a plurality of feature vectors; inputting the feature vectors and the feature points into the main capsule layer to generate a plurality of activity vectors; and generating a recognition result corresponding to the image based on the activity vector by at least one routing capsule layer and the output layer.
[0015] Based on the above, the present invention improves the architecture and operation mechanism of the capsule network and introduces the geometric information in the image to be recognized into the overall recognition mechanism, thereby achieving a better geometric understanding of the image and helping to improve the accuracy of the overall recognition.
[0016] In order to make the above features and advantages of the present invention more clearly understood, embodiments are given below with reference to the accompanying drawings for detailed description.
Brief Description of the Drawings
[0017] Figure 1 is a schematic diagram of an image recognition device according to an embodiment of the present invention.
[0018] Figure 2 is a flow chart of an image recognition method according to an embodiment of the present invention.
[0019] Figure 3 FIG. 4 is a schematic diagram of capturing feature points in an image according to an embodiment of the present invention.
[0020] Figure 4 is based on Figure 3 A schematic diagram of recognition based on capsule network is shown.
[0021]
Explanation of symbols
[0022] 100: Image recognition device
[0023] 102: Storage Circuit
[0024] 104: Processor
[0025] 300: Image
[0026] 305: Feature Point Extraction Network
[0027] 305a: Convolutional layer
[0028] 310: Feature point image
[0029] 310a: Feature point
[0030] 405: Capsule Network
[0031] AV: Activity Vector
[0032] CL: Convolutional Layer
[0033] DC: Output layer
[0034] FPV: Feature Point Vector
[0035] FV: Feature Vector
[0036] IM1: First input matrix
[0037] IMC: Input Matrix Merging Layer
[0038] IV: Input vector
[0039] IVC: Input Vector Pooling Layer
[0040] M1: First matrix
[0041] M2: Second Matrix
[0042] OV: Output Vector
[0043] PL: Primary Capsule Layer
[0044] RL: Routing Capsule Layer
[0045] S210~S250: steps. [Specific implementation method]
[0046] Please refer to Figure 1 , which is a schematic diagram of an image recognition device according to an embodiment of the present invention. In different embodiments, the image recognition device 100 may be a smart phone, a tablet computer, a personal computer, a notebook computer or other devices with image processing functions, but is not limited thereto. Figure 1 As shown, the image recognition device 100 may include a storage circuit 102 and a processor 104. The storage circuit 102 is, for example, any type of fixed or removable random access memory (RAM), read-only memory (ROM), flash memory, hard disk or other similar devices or a combination of these devices, and can be used to record multiple program codes or modules.
[0047] The processor 104 is coupled to the memory circuit 102 and may be a general purpose processor, a special purpose processor, a conventional processor, a digital signal processor, a plurality of microprocessors, one or more microprocessors combined with a digital signal processor core, a controller, a microcontroller, an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), any other type of integrated circuit, a state machine, an Advanced RISC Machine (ARM) based processor, and the like.
[0048] In an embodiment of the present invention, the processor 104 can access the modules and program codes recorded in the storage circuit 102 to implement the image recognition method proposed by the present invention, the details of which are described as follows.
[0049] Please refer to Figure 2 , which is a flow chart of an image recognition method according to an embodiment of the present invention. The method of this embodiment can be Figure 1 The image recognition device 100 is executed as follows: Figure 1 Description of components shown Figure 2 Details of each step.
[0050] First, in step S210, the processor 104 may obtain an image and capture a plurality of feature points in the image. In different embodiments, the image may be an image of a specific object captured by the image recognition device 100 through an imaging component, an image of an object captured from any image database or storage location, an image of an object in a video, or any other image, but is not limited thereto. To facilitate understanding of the concept of the present invention, the following will be supplemented with Figure 3 This is for further explanation, but it is not intended to limit the possible implementation methods of the present invention.
[0051] Please refer to Figure 3, which is a schematic diagram of capturing feature points in an image according to an embodiment of the present invention. In this embodiment, the image 300 is, for example, an image including a face (i.e., a specific object). The image 300 may include a plurality of first pixels, and each first pixel may include a plurality of color channel information. Assume that the length and width of the image 300 are H and W, respectively, and each first pixel has three color channel information (which may correspond to R, G, and B channels, for example, respectively). In this case, each first pixel can be represented by the method of (R, G, B). Accordingly, the image 300 may be represented, for example, as a W×H×3 matrix (hereinafter referred to as the first matrix M1), but the present invention may not be limited thereto. In addition, the color channel information may have other types, such as the coordinate position of the image 300 and the three color channel information (which may correspond to Y, U, and V channels, for example, respectively). Accordingly, the image 300 may be represented, for example, as a W×Y×3 matrix.
[0052] like Figure 3 As shown, the processor 104 may input the image 300 into the feature point extraction network 305 , so that the feature point extraction network 305 can identify feature points 310 a located in the image 300 .
[0053] For ease of explanation, the feature points 310a considered in the embodiment of the present invention may be assumed to be facial feature points located on the face of the person in the image 300 (which may correspond to facial features such as the nose tip and the chin), but are not limited thereto. To achieve this purpose, the processor 104 may correspondingly adopt a feature point extraction network 305 for extracting facial feature points, such as a CNN network implemented based on technologies such as Convolutional Neural Networks (CNN), Multi-task Cascaded Convolutional Neural Networks (MTCNN), Dense Facial Landmarks, and Retina Face, and may include, for example, a convolution layer 305a, but is not limited thereto.
[0054] In one embodiment, after the feature point extraction network 305 extracts the feature points 310a from the image 300, these feature points 310a may be presented accordingly using the feature point image 310. Specifically, the feature point image 310 may include a plurality of second pixels. In this embodiment, when the length and width of the image 300 are H and W, respectively, the length and width of the feature point image 310 will also be H and W, respectively. Accordingly, the feature point image 310 may be represented as a W×H×1 matrix (hereinafter referred to as the second matrix M2), and each matrix element thereof may correspond to one of the above-mentioned second pixels. It should be understood that in order to maintain the simplicity of the drawing, Figure 3Only one feature point 310a is indicated in the figure, and a person skilled in the art should understand that the remaining points in the feature point image 310 are also feature points, but the present invention is not limited thereto.
[0055] In one embodiment, the first portion of the second pixel corresponding to the feature point 310a may be defined as a first value (e.g., "1"), and the second portion of the second pixel not corresponding to the feature point 310a may be defined as a second value (e.g., "0"). In this case, the matrix elements corresponding to each feature point 310a in the second matrix M2 may be represented as 1, and the matrix elements not corresponding to each feature point 310a may be represented as 0.
[0056] In addition, after the feature point extraction network 305 extracts the feature points 310a from the image 300, each feature point 310a may be output in the form of a 1×1 vector. Specifically, it is assumed that the feature point extraction network 305 is configured to extract a fixed number, hereinafter referred to as K feature points 310a, from the image 300. In this case, the feature point extraction network 305 may extract K feature points 310a represented in the form of a 1×1 vector in response to the image 300. Moreover, the arrangement order of the K feature point vectors (hereinafter referred to as feature point vectors FPV) corresponding to the feature points 310a will also have a certain rule. More specifically, the feature point vectors corresponding to a certain feature will be arranged in a fixed order. For example, the order of the feature point vectors corresponding to the tip of the nose will be fixed to be arranged at the i-th in the K vectors, and the order of the feature point vectors corresponding to the chin will be fixed to be arranged at the j-th in the K vectors, but the present invention is not limited to this.
[0057] Next, in step S220, the processor 104 may obtain a capsule network. In an embodiment of the present invention, the capsule network may include, for example, a convolutional layer, one or more capsule layers (the number of which is, for example, P), and an output layer (also called a digit capsule layer) in sequence.
[0058] Based on the understanding of capsule networks by ordinary technicians in the field, it can be known that in the above P capsule layers, the first capsule layer can be generally referred to as a primary capsule layer, and the second to Pth capsule layers can be generally referred to as routing capsule layers. Each capsule layer may include one or more capsules. According to the general definition of capsule networks, each capsule is a group of neurons, and the activity vector of this group of neurons can represent the instantiation parameter of a specific type of entity (such as an object or a part of an object).
[0059] For ease of explanation, in the embodiment of the present invention, only the output of each capsule in the main capsule layer is referred to as an activity vector, and the output of each capsule in each routing capsule layer is referred to as an output vector, but this is not intended to limit the implementation manner of the present invention.
[0060] Generally speaking, the convolution layer can be used as the input layer of the capsule network and can be used to perform feature extraction operations on the received input (such as an image or a data matrix). In this case, the vectors output by each neuron in the convolution layer can be called feature vectors (whose individual dimensions are, for example, N×1), and these feature vectors can be used as inputs to the main capsule layer. After the main capsule layer receives the above N feature vectors, it can generate corresponding multiple activity vectors (whose number corresponds to the number of capsules in the main capsule layer) based on these feature vectors, and provide these activity vectors to the first routing capsule layer.
[0061] Afterwards, the first routing capsule layer may generate multiple output vectors based on the activity vector. For the kth (k is between 2 and P) routing capsule layer, it may generate multiple output vectors of the kth routing capsule layer based on the output vector generated by the (k-1)th routing capsule layer. Then, the output layer after the capsule network may convert the output vector generated by the Pth routing capsule layer into a corresponding recognition result.
[0062] However, since the above method does not introduce the geometric information of the image to be recognized into the overall recognition mechanism, it is impossible to have a better geometric understanding of the image, which may lead to poor recognition results. Therefore, the present invention improves the architecture and operation mechanism of the capsule network, which helps to improve the accuracy of overall recognition.
[0063] To facilitate understanding of the concept of the present invention, the following will be supplemented by Figure 4 This is for further explanation, but it is not intended to limit the possible implementation methods of the present invention.
[0064] Please refer to Figure 4 , which is based on Figure 3 In this embodiment, the capsule network 405 obtained by the processor 104 may include, for example, an input matrix concatenation layer IMC, a convolution layer CL, an input vector concatenation layer IVC, a main capsule layer PL, a routing capsule layer RL, and an output layer DC in sequence. Figure 4 Only one routing capsule layer RL is indicated in FIG. 1 , and a person skilled in the art should understand that there may be one or more routing capsule layers RL, but the present invention is not limited thereto. Figure 4In the description, the number of vectors output by each layer is represented by K, but a person skilled in the art can understand that the number of vectors output by each layer may not be equal according to the design and the number may be arranged in increasing or decreasing order. For example, the main capsule layer PL may output K activity vectors, and the routing capsule layer RL may generate 2K output vectors OV based on the above K activity vectors AV, and so on.
[0065] In summary, in the capsule network 405 of the present embodiment, the convolution layer CL can take the image 300 to be recognized as input, and can also consider each feature point 310a in the feature point image 310. Moreover, for the main capsule layer PL, different from the known practice of only taking the output of the convolution layer CL as input, the embodiment of the present invention can also take each feature point 310a in the feature point image 310 into consideration. In this way, the present invention can allow the capsule network 405 to have a better geometric understanding of the image 300 by considering the image 300 and the feature point 310a at the same time, so that the overall recognition mechanism can achieve more accurate recognition performance without a large amount of training data. The detailed description is as follows.
[0066] In step S230, the processor 104 may input the image and the feature point 310a into the convolution layer CL to generate a plurality of feature vectors FV. In one embodiment, the processor 104 may input the value of each second pixel and the color channel information of each corresponding first pixel into the input matrix merging layer IMC to merge and output the first input matrix IM1. Specifically, as described in the previous embodiment, since each first pixel in the image 300 may have three color channel information such as R, G, and B, each first pixel may be represented by (R, G, B). Moreover, each first pixel has a second pixel at a corresponding position in the feature point image 310, and the value of each second pixel will be 1 or 0 depending on whether it corresponds to the feature point 310a or not.
[0067] In this case, the processor 104 may merge the (R, G, B) of the first pixel and the value of the corresponding second pixel into (R, G, B, X), where if the corresponding second pixel corresponds to one of the feature points 310a, then X is 1, otherwise it is 0. That is, if the second pixel corresponding to a first pixel in the image 300 is one of the feature points 310a, then a merged result of (R, G, B, 1) may be generated. On the other hand, if the second pixel corresponding to a first pixel is not any feature point, then a merged result of (R, G, B, 0) may be generated, but the present invention is not limited thereto. In this way, the merged result corresponding to each first pixel may be represented as a first input matrix IM1 of W×H×4. From another point of view, the first input matrix IM1 may also be regarded as the result of merging the first matrix M1 (whose dimension is W×H×3) and the second matrix M2 (whose dimension is W×H×1), but is not limited thereto.
[0068] Afterwards, the processor 104 may input the first input matrix IM1 to the convolution layer CL, so that the convolution layer CL performs a feature extraction operation on the first input matrix IM1 to generate a feature vector FV. That is, in the capsule network 405 architecture of the present invention, the first input matrix IM1 (i.e., the merged first matrix M1 and second matrix M2) is used as the input of the convolution layer CL, rather than directly using the first matrix M1 corresponding to the image 300 as the input of the convolution layer CL.
[0069] In this embodiment, the convolution layer CL may generate K feature vectors FV (each of which has a dimension of N×1, for example). The specific details of the feature extraction operation performed by the convolution layer CL may be referred to in related known technical documents and will not be described in detail here.
[0070] After generating the feature vector FV, in step S240, the processor 104 may input the feature vector FV and the feature point 310a into the primary capsule layer PL to generate a plurality of activity vectors AV. In one embodiment, the processor 104 may input the value of each second pixel and the corresponding feature vector FV into the input vector merging layer IVC for merging and output a plurality of input vectors IV. Specifically, as described in the previous embodiment, the K feature points 310a may be represented as K feature point vectors FPV (each of which has a dimension of 1×1). In this case, the processor 104 may merge each feature point vector FPV (whose dimension is 1×1) with the corresponding feature vector FV (whose dimension is N×1) into an input vector IV (whose dimension is (N+1)×1). For example, the processor 104 may merge the zth feature point vector FPV with the zth feature vector FV into the zth input vector IV. That is, the order of the feature points 310a (i.e., the order of the feature point vectors FPV) corresponds to the order of the feature vectors FV.
[0071] After generating K input vectors IV based on the above merging operation, the processor 104 may input the input vector IV to the main capsule layer PL, so that the main capsule layer PL generates an activity vector AV (whose dimension is N×1) based on the input vector IV. In other words, in the capsule network 405 architecture proposed in the present invention, the input vector IV (i.e., the merged feature vector FV and feature point vector FPV) is used as the input of the main capsule layer PL, rather than directly using the feature vector FV as the input of the main capsule layer PL. The operating mechanism of each capsule layer of the present invention can be performed based on a method well known to those skilled in the art, and will not be further described here.
[0072] Then, in step S250, the processor 104 may generate a recognition result corresponding to the image 300 based on the activity vector AV by using the routing capsule layer RL and the output layer DC. Figure 4In this scenario, since the capsule network 405 only includes one routing capsule layer RL, the routing capsule layer RL can generate K output vectors OV (whose respective dimensions are, for example, N×1) based on the K activity vectors AV.
[0073] Afterwards, the processor 104 may convert the output vector OV generated by the routing capsule layer RL into a recognition result corresponding to the image 300 (eg, a specific identity of the person in the image 300 ) through the output layer DC.
[0074] In other embodiments, if the adopted capsule network includes P routing capsule layers, the processor 104 may be configured to: generate a plurality of output vectors based on the activity vector AV by the first routing capsule layer; generate a plurality of output vectors of the kth routing capsule layer based on the output vector generated by the (k-1)th routing capsule layer by the kth routing capsule layer, where k is between 2 and P; and convert the output vector generated by the Pth routing capsule layer into a recognition result corresponding to the image 300 by the output layer DC.
[0075] In addition, in an embodiment using P routing capsule layers, the number of activity vectors AV of the main capsule layer PL can be designed to be no greater than the number of output vectors of the first routing capsule layer. Furthermore, the number of output vectors of the jth routing capsule layer (e.g., 64) can be designed to be no greater than the number of output vectors of the (j+1)th routing capsule layer (e.g., 64, 128, 256, or 512, etc.), where j is between 1 and (P-1). In this way, the capsule network can more effectively represent the original image (e.g., image 300), thereby helping to improve the accuracy of subsequent recognition.
[0076] Furthermore, the input matrix merging layer IMC and the input vector merging layer IVC are used to perform array merging operations, and those skilled in the art should be aware that similar merging operations may also be used, which will not be described in detail herein.
[0077] In short, the method of the present invention can be understood as being based on two neural networks. In the first neural network, a traditional CNN can be used to extract feature points in the image. For example, a face image can be input into a CNN to use several convolutional layers therein to extract and transform features, and then a fully connected layer and other techniques are used to generate face feature points in the image under consideration. In the second neural network (i.e., capsule network), a multiple input form of "face feature points + face image" can be used, and one or several convolutional layers are used to re-extract features, and then the extracted features are combined with the face feature points for one or several capsule operations, and finally the recognition result is obtained through the output layer or other techniques.
[0078] In summary, the image recognition method and device of the present invention can first use the feature point extraction network to find the feature points in the image, and then use the improved capsule network architecture to use the feature points as the geometric meaning of the image to assist in image recognition. By feeding additional geometric meaning information (face feature points) into the capsule network at the appropriate time, the capsule network's understanding of the additional geometric meaning can be enhanced. In this way, the capsule network can better combine the object features with its geometric meaning, so that the capsule network can obtain a better understanding of the object and thus improve recognition capabilities.
[0079] Since the capsule network of the present invention can better understand the object, it means that a better model can be trained with a smaller sample, thereby achieving a better recognition effect. Moreover, better object understanding means that in addition to accurate recognition, the capsule network of the present invention can also grasp the relative geometric relationship of the object details to enhance the understanding of the artistic conception presented by the object content, thereby allowing the current low-level artificial intelligence to further develop into high-level artificial intelligence. Furthermore, since the capsule network can achieve a better understanding of geometric meaning, the trained model has better anti-deception resistance.
[0080] In addition, during the training process, the two networks used in the present invention can be learned simultaneously or trained separately. In some embodiments, a large amount of data can be used to train the two networks, or an end-to-end training method can be used to train the two networks simultaneously, or the two training methods can be used interchangeably. In this case, the existing training data can be better utilized.
[0081] Although the present invention has been disclosed as above by the embodiments, it is not intended to limit the present invention. Any ordinary technician in the technical field can make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the definition of the attached claims. However, the above-mentioned contents are only the preferred embodiments of the present invention, and should not be used to limit the scope of implementation of the present invention. That is, all simple equivalent changes and modifications made according to the claims and specifications of the present invention are still within the scope of the patent of the present invention. In addition, any embodiment or claim of the present invention does not need to achieve all the purposes, advantages or features disclosed by the present invention. In addition, the abstract part and the title are only used to assist in searching patent documents, and are not used to limit the scope of rights of the present invention. In addition, the terms "first", "second", etc. mentioned in this specification or claims are only used to name the name of the component (element) or to distinguish different embodiments or scopes, and are not used to limit the upper or lower limit of the number of components.
Claims
1. An image recognition method, comprising: Acquire an image, and extract a plurality of feature points in the image; Obtain a capsule network, wherein the capsule network sequentially comprises a convolutional layer, a main capsule layer, at least one routing capsule layer, and an output layer; Inputting the image and the plurality of feature points into the convolution layer to generate a plurality of feature vectors; Inputting the plurality of feature vectors and the plurality of feature points into the primary capsule layer to generate a plurality of activity vectors; as well as The at least one routing capsule layer and the output layer generate a recognition result corresponding to the image based on the multiple activity vectors.
2. The method according to claim 1, wherein the step of capturing the plurality of feature points in the image comprises: The image is input into a feature point extraction network so that the feature point extraction network identifies the plurality of feature points located in the image, wherein an order of the plurality of feature points corresponds to an order of the plurality of feature vectors.
3. The method according to claim 2, wherein the feature point extraction network is a convolutional neural network.
4. The method according to claim 1, wherein the image has a plurality of first pixels, each of the first pixels includes a plurality of color channel information, the plurality of feature points are located in a feature point image, the feature point image includes a plurality of second pixels corresponding to the plurality of first pixels, wherein a first portion of the plurality of second pixels corresponding to the plurality of feature points is defined as a first value, and a second portion of the plurality of second pixels not corresponding to the plurality of feature points is defined as a second value; in, The step of inputting the image and the plurality of feature points into the convolution layer to generate the plurality of feature vectors comprises: Combining the value of each of the second pixels and the plurality of color channel information of the corresponding first pixels into a first input matrix; and The first input matrix is input to the convolution layer, so that the convolution layer performs a feature extraction operation on the first input matrix to generate the plurality of feature vectors.
5. The method according to claim 1, wherein the image has a plurality of first pixels, the plurality of feature points are located in a feature point image, the feature point image includes a plurality of second pixels corresponding to the plurality of first pixels, wherein a first portion of the plurality of second pixels corresponding to the plurality of feature points is defined as a first value, and a second portion of the plurality of second pixels not corresponding to the plurality of feature points is defined as a second value; in, The step of inputting the plurality of feature vectors and the plurality of feature points into the main capsule layer to generate the plurality of activity vectors comprises: Combining the values of each of the second pixels and the corresponding feature vectors into a plurality of input vectors; and The plurality of input vectors are input to the primary capsule layer, so that the primary capsule layer generates the plurality of activity vectors based on the plurality of input vectors.
6. The method according to claim 1, wherein the at least one routing capsule layer sequentially includes a first routing capsule layer to a Pth routing capsule layer, P is the number of the at least one routing capsule layer, and the step of generating the recognition result corresponding to the image based on the plurality of activity vectors by the at least one routing capsule layer and the output layer comprises: Generating a plurality of output vectors by the first routing capsule layer based on the plurality of activity vectors; The kth routing capsule layer generates a plurality of output vectors of the kth routing capsule layer based on the plurality of output vectors generated by the (k-1)th routing capsule layer, wherein 2≤k≤P; as well as The output layer converts the multiple output vectors generated by the P-th routing capsule layer into the recognition result corresponding to the image.
7. The method according to claim 6, wherein the number of the multiple activity vectors of the main capsule layer is not greater than the number of the multiple output vectors of the first routing capsule layer, and the number of the multiple output vectors of the j-th routing capsule layer is not greater than the number of the multiple output vectors of the (j+1)-th routing capsule layer, where 1≤j≤P-1.
8. An image recognition device, comprising a storage circuit and a processor, wherein: The storage circuit stores a plurality of modules; and The processor is coupled to the storage circuit and accesses the plurality of modules to perform the following steps: Acquire an image, and extract a plurality of feature points in the image; Obtain a capsule network, wherein the capsule network sequentially comprises a convolutional layer, a main capsule layer, at least one routing capsule layer, and an output layer; Inputting the image and the plurality of feature points into the convolution layer to generate a plurality of feature vectors; Inputting the plurality of feature vectors and the plurality of feature points into the primary capsule layer to generate a plurality of activity vectors; as well as The at least one routing capsule layer and the output layer generate a recognition result corresponding to the image based on the multiple activity vectors.
9. The apparatus of claim 8, wherein the processor is configured: The image is input into a feature point extraction network so that the feature point extraction network identifies the plurality of feature points located in the image, wherein an order of the plurality of feature points corresponds to an order of the plurality of feature vectors.
10. The device according to claim 9, wherein the feature point extraction network is a convolutional neural network.
11. The device according to claim 8, wherein the image has a plurality of first pixels, each of the first pixels includes a plurality of color channel information, the plurality of feature points are located in a feature point image, the feature point image includes a plurality of second pixels corresponding to the plurality of first pixels, wherein a first portion of the plurality of second pixels corresponding to the plurality of feature points is defined as a first value, and a second portion of the plurality of second pixels not corresponding to the plurality of feature points is defined as a second value; in, The processor is configured to: Combining the value of each of the second pixels and the plurality of color channel information of the corresponding first pixels into a first input matrix; as well as The first input matrix is input to the convolution layer, so that the convolution layer performs a feature extraction operation on the first input matrix to generate the plurality of feature vectors.
12. The apparatus according to claim 8, wherein the image has a plurality of first pixels, the plurality of feature points are located in a feature point image, the feature point image includes a plurality of second pixels corresponding to the plurality of first pixels, wherein a first portion of the plurality of second pixels corresponding to the plurality of feature points is defined as a first value, and a second portion of the plurality of second pixels not corresponding to the plurality of feature points is defined as a second value; in, The processor is configured to: Combining the values of each of the second pixels and the corresponding feature vectors into a plurality of input vectors; as well as The plurality of input vectors are input to the primary capsule layer, so that the primary capsule layer generates the plurality of activity vectors based on the plurality of input vectors.
13. The apparatus according to claim 8, wherein the at least one routing capsule layer sequentially comprises a 1st routing capsule layer to a Pth routing capsule layer, P is the number of the at least one routing capsule layer, and the processor is configured: Generating a plurality of output vectors by the first routing capsule layer based on the plurality of activity vectors; Generating, by the kth routing capsule layer, a plurality of output vectors of the kth routing capsule layer based on the plurality of output vectors generated by the (k-1)th routing capsule layer, wherein 2≤k≤P; and The output layer converts the multiple output vectors generated by the P-th routing capsule layer into the recognition result corresponding to the image.
14. The apparatus according to claim 13, wherein the number of the multiple activity vectors of the main capsule layer is not greater than the number of the multiple output vectors of the first routing capsule layer, and the number of the multiple output vectors of the j-th routing capsule layer is not greater than the number of the multiple output vectors of the (j+1)-th routing capsule layer, where 1≤j≤P-1.
Citation Information
Patent Citations
Auxiliary film reading system and method for capsule endoscope image
CN106934799A
Distribution network live-line work condition discrimination method based on text classification and image recognition
CN109614488A
