Cow face recognition method, system, device and medium based on graph convolutional network model
Through the multi-level multi-scale global-local information interaction of the graph convolution network model, the problem of difficulty in face recognition is solved, the accuracy of face recognition is improved, and more stable and accurate face recognition is achieved.
Patent Information
- Application Number
- CN202210292944.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2042-03-24
AI Technical Summary
There is a high difficulty in identifying cow faces, especially under the influence of factors such as high similarity of cow faces, small differences in facial features, changes in hair and texture, changes in lighting conditions, different perspectives and distances, and complex backgrounds. Difficult to effectively identify.
Using a graph convolution network model, the features of the cow face image are extracted through multi-level and multi-scale global-local information interaction, and the three-layer structure graph is constructed. The graph convolution network is used for information interaction and fusion, which improves the cow face recognition. accuracy.
It significantly improves the accuracy of cow face recognition, and the information interaction between graph nodes is more traceable, providing better feature information, and enhancing the stability and accuracy of recognition.
Smart Images

Figure CN114743215B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a cow face recognition method, system, device and medium based on a graph convolutional network model, and belongs to the field of computer vision. Background Art
[0002] At present, there are many methods for identification and verification using graph convolution, but most of them are used on faces / human bodies. In agriculture and animal husbandry, there are also corresponding needs. Realizing individual animal identification and verification is an indispensable step in animal husbandry. Compared with the traditional wearable tag method, using video images for individual animal identification and verification has the advantages of convenient and intuitive data acquisition, non-contact, non-invasive and less human stress.
[0003] Different from the recognition and verification of human faces / human bodies, cow faces have many different characteristics. In many cases, cow faces are more similar than human faces, and animals of the same species and similar size have similar facial features. At the same time, animals have a short growth cycle, and their faces and body shapes will change greatly in a short period of time. In terms of facial features, cows have hair on their faces, and there are interference factors such as texture changes, which increase the difficulty of cow face recognition. Compared with humans, animal image collection is more uncontrollable, and it is impossible for animals to consciously keep their faces stable in front of the camera for a long time, especially in natural and wild environments. Factors such as changes in lighting conditions, different viewing angles and distances, and complex backgrounds make animal image collection more difficult. Unsatisfactory facial images will have a negative impact on model training and recognition. For this reason, there is an urgent need for a recognition method that can target the above differences and is different from that on human faces / human bodies. Summary of the invention
[0004] In view of this, the present invention provides a cow face recognition method, system, device and medium based on a graph convolutional network model, which performs multi-level and multi-scale global-local information interaction on the extracted original features through the graph convolutional network, effectively integrating the global-local information of the cow face image, thereby significantly improving the accuracy of cow face recognition.
[0005] The first object of the present invention is to provide a cow face recognition method based on a graph convolutional network model.
[0006] The second object of the present invention is to provide a cow face recognition system based on a graph convolutional network model.
[0007] A third object of the present invention is to provide a computer device.
[0008] A fourth object of the present invention is to provide a storage medium.
[0009] The first object of the present invention can be achieved by adopting the following technical solutions:
[0010] A cow face recognition method based on a graph convolutional network model, the method comprising:
[0011] Get the cow face image;
[0012] Use the feature extraction network to perform preliminary feature extraction on the cow face image to obtain the original feature map;
[0013] Based on the original feature map, multi-scale and multi-level feature division is performed and the nodes of the graph convolutional network are initialized. The graph convolutional network is used to perform multi-scale and multi-level global-local information interaction to achieve further feature extraction.
[0014] The features after global-local information interaction are used for classification to obtain the identity corresponding to the current cow face.
[0015] Furthermore, based on the original feature map, multi-scale and multi-level feature division is performed and nodes of the graph convolution network are initialized, and the graph convolution network is used to perform multi-scale and multi-level global-local information interaction, specifically including:
[0016] Based on the original feature graph, a three-layer graph is constructed as the graph structure in the graph convolutional network;
[0017] Based on the three-layer structure graph, the original feature map is converted into a three-layer feature matrix using pooling operations of different sizes;
[0018] Use the three-layer feature matrix to initialize the graph nodes of the corresponding layer, and obtain the size and position of the information source area of each graph node in each layer;
[0019] According to the size and position of the information source area of each layer of each graph node, a three-layer stereoscopic structure is constructed;
[0020] According to the three-layer feature matrix, the adjacency matrix in the graph convolutional network is reorganized;
[0021] Based on the adjacency matrix in the graph convolutional network, a graph convolutional layer in the graph convolutional network is used to perform information interaction and fusion.
[0022] Furthermore, the graph based on the three-layer structure uses pooling operations of different sizes to convert the original feature map into a three-layer feature matrix, as shown in the following formula:
[0023] f matrix-i =φ i (f I )
[0024] Among them, f matrix-i represents the feature matrix of the i-th layer, with a size of n×m, where n represents the number of graph nodes in the i-th layer, m represents the number of channels in the original feature graph, and f I represents the original feature map, φi Indicates that the i-th layer uses the corresponding layer pooling operation from f I The operation of extracting eigenvectors and arranging them into a feature matrix;
[0025] The i-th layer uses the corresponding pooling operation from f I The operations of extracting eigenvectors and arranging them into a feature matrix include:
[0026] Use the corresponding pooling kernel to extract the i×i×C feature map from the original feature map;
[0027] The i×i×C feature map is reorganized into a feature matrix with i×i rows and C columns, where i represents the corresponding layer number and C represents the number of channels of the original feature map.
[0028] Furthermore, in the three-layer stereoscopic structure, the first layer has one graph node, the second layer has four graph nodes, and the third layer has nine graph nodes;
[0029] The graph nodes in each layer are arranged according to the position of the information acquisition area in the original feature map; adjacent graph nodes in the same layer and adjacent graph nodes in different layers use edge overlapping information extraction method, and establish connections based on the coverage relationship.
[0030] Furthermore, the adjacency matrix in the graph convolutional network is reorganized according to the three-layer feature matrix, as shown in the following formula:
[0031] A=Ψ(f matrix-1 ,f matrix-2 ,f matrix-3 )
[0032] Among them, A represents the adjacency matrix in the graph convolutional network, Ψ represents the method of reshaping the feature matrix, and f matrix-1 ,f matrix-2 ,f matrix-3 Represent the feature matrices extracted from the three levels respectively.
[0033] Furthermore, based on the adjacency matrix in the graph convolutional network, a graph convolutional layer in the graph convolutional network is used to perform information interaction fusion, as shown in the following formula:
[0034]
[0035] in, A represents the adjacency matrix in the graph convolutional network, X represents the feature matrix composed of the feature vectors of all graph nodes, and W represents the weight of the graph convolutional network.
[0036] Furthermore, the feature extraction network selects the first 41 layers of ResNet50;
[0037] The feature extraction network is used to perform preliminary feature extraction on the cow face image to obtain the original feature map, which is as follows:
[0038] The cow face image is input into the feature extraction network to obtain the original feature map of size W×H×C, where W represents width, H represents height and C represents the number of channels.
[0039] The second object of the present invention can be achieved by adopting the following technical solutions:
[0040] A cow face recognition system based on a graph convolutional network model, the system comprising:
[0041] An acquisition unit, used for acquiring a cow face image;
[0042] A first feature extraction unit is used to perform preliminary feature extraction on the cow face image using a feature extraction network to obtain an original feature map;
[0043] The second feature extraction unit is used to perform multi-scale and multi-level feature division based on the original feature map and initialize the nodes of the graph convolution network, and use the graph convolution network to perform multi-scale and multi-level global-local information interaction to achieve further feature extraction;
[0044] The classification unit is used to perform classification using features that have undergone global-local information interaction to obtain an identity label corresponding to the current cow face.
[0045] The third object of the present invention can be achieved by adopting the following technical solutions:
[0046] A computer device comprises a processor and a memory for storing a program executable by the processor, wherein when the processor executes the program stored in the memory, the above-mentioned cow face recognition method is implemented.
[0047] The fourth object of the present invention can be achieved by adopting the following technical solutions:
[0048] A storage medium stores a program, and when the program is executed by a processor, the above-mentioned cow face recognition method is implemented.
[0049] The present invention has the following beneficial effects compared with the prior art:
[0050] (1) The present invention uses a graph convolutional network to perform multi-level and multi-scale global-local information interaction on the extracted original features, effectively integrating the global-local information of the cow face image, thereby significantly improving the accuracy of cow face recognition.
[0051] (2) The connection method between graph nodes in the embodiment of the present invention can make the information interaction between graph nodes more traceable and at the same time make the information correlation between graph nodes stronger; in addition, this connection method can not only learn information of multiple levels and scales in the stable structure during the information interaction process, but also provide better feature information after the information interaction is fused. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0053] Figure 1 This is a simplified flowchart of a cow face recognition method based on a graph convolutional network model according to Embodiment 1 of the present invention.
[0054] Figure 2 This is a specific flow chart of the cow face recognition method based on the graph convolutional network model of Example 1 of the present invention.
[0055] Figure 3 This is a structural diagram of the graph convolutional network of Example 1 of the present invention.
[0056] Figure 4 This is a flow chart of a cow face recognition system based on a graph convolutional network model according to Example 2 of the present invention.
[0057] Figure 5 This is a structural block diagram of a computer device according to Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0059] Embodiment 1:
[0060] like Figure 1 and Figure 2 As shown, this embodiment provides a cow face recognition method based on a graph convolutional network model, and the method includes the following steps:
[0061] S201, obtaining a cow face image.
[0062] This embodiment is mainly aimed at dairy cows. The video of the cattle activity is recorded by a camera device, and the cow face is captured from the video of the cattle activity, so as to obtain a cow face image, that is, an image of the cow's facial area.
[0063] S202, using a feature extraction network to perform preliminary feature extraction on the cow face image to obtain an original feature map.
[0064] The cow face image is input into the feature extraction network to obtain an original feature map of size W×H×C, where W, H, and C represent the width, height, and number of channels of the original feature map, respectively.
[0065] The input size of the cow face image in this embodiment is 448×448, and after being processed by the feature extraction network, an original feature map of 28×28×1024 is obtained; the original feature map is used as the information source for initializing subsequent graph nodes; wherein, the original feature map extracted after convolution can allow subsequent graph nodes to obtain more abstract initialization feature information.
[0066] The feature extraction network in this embodiment selects the first 41 layers of ResNet50.
[0067] S203. Based on the original feature map, perform multi-scale and multi-level feature division and initialize the nodes of the graph convolutional network. Use the graph convolutional network to perform multi-scale and multi-level global-local information interaction to achieve further feature extraction.
[0068] like Figure 3 As shown, this embodiment constructs a three-layer graph based on the initial extracted original feature graph as the graph structure in the graph convolutional network, and uses pooling operations of different sizes to obtain feature vectors at different levels according to the principle of layer-by-layer refinement; wherein the corresponding feature source areas gradually become smaller and partially overlap, and an extraction method with edge overlap is used to avoid the loss of some cross-regional information when dividing the areas; in addition to obtaining a three-layer graph, this embodiment also obtains 14 feature vectors from information source areas of different sizes, and then uses these feature vectors to initialize the corresponding graph nodes in the graph convolutional network.
[0069] This embodiment performs multi-scale and multi-level feature division and initializes the nodes of the graph convolutional network, and uses the graph convolutional network to perform multi-scale and multi-level global-local information interaction. The specific steps are as follows:
[0070] S2031. Based on the original feature graph, a three-layer graph is constructed as the graph structure in the graph convolutional network.
[0071] S2032. Based on the three-layer structure graph, pooling operations of different sizes are used to convert the original feature map into a three-layer feature matrix.
[0072] At the i-th layer, the original feature map is converted into a feature matrix that can be used to initialize the graph nodes. The number of rows of the feature matrix corresponds to the number of nodes at the i-th layer, and the number of columns corresponds to the number of channels of the original feature map, thereby obtaining the conversion from the original feature map to the feature matrix of the corresponding layer. The specific formula is as follows:
[0073] f matrix-i =φ i (f I )
[0074] Among them, f matrix-i represents the feature matrix of the i-th layer, f I represents the original feature map, φ i Indicates that the i-th layer uses the corresponding layer pooling operation from f I The operation of extracting eigenvectors and arranging them into a feature matrix in sequence.
[0075] The size of the feature matrix of the i-th layer is n×m, where n represents the number of graph nodes in the i-th layer and m represents the number of channels of the original feature graph. The feature vector corresponding to each row in the feature matrix is the feature vector of the graph node corresponding to that row.
[0076] The i-th layer uses the corresponding layer pooling operation from f I The operations of extracting feature vectors and arranging them into a feature matrix in sequence are as follows: using the corresponding pooling kernel (pooling kernel of appropriate size) to extract i×i×C feature maps from the original feature map; reorganizing the i×i×C feature maps into a feature matrix with i×i rows and C columns, where i represents the corresponding number of layers and C represents the number of channels of the original feature map.
[0077] S2033. Use the three-layer feature matrix to initialize the graph nodes of the corresponding layer, and obtain the size and position of the information source area of each graph node in each layer.
[0078] In this embodiment, the original feature map of 28×28×1024 is obtained based on step S202, and a three-layer feature matrix is obtained according to step S2032, which is as follows:
[0079] (1) The pooling size used in the first layer is 28×28, and 1 feature vector is obtained; further, according to step S2032, the first layer feature matrix is obtained.
[0080] (2) The pooling size used in the second layer is 21×21, and the step size is 7, and a total of 4 feature vectors are obtained, corresponding to the upper left, upper right, lower left, and lower right regions of the feature map; further, according to step S2032, the second layer feature matrix is obtained.
[0081] (3) The pooling size used in the third layer is 14×14, and the step size is 7, and a total of 9 feature vectors are obtained, which also correspond to the 9 regions of the feature map; further, according to step S2032, the third layer feature matrix is obtained.
[0082] This embodiment uses the above three-layer feature matrix to initialize the graph nodes of the corresponding layer, and obtains the size and position of the information source area of each graph node in each layer.
[0083] The regular and spatially related graph node initialization method in this embodiment can extract interrelated feature information that comes from multiple levels and scales, wherein the feature information is the source of global information and local information in the graph convolutional network.
[0084] S2034. Construct a three-layer stereoscopic structure according to the size and position of the information source area of each graph node in each layer.
[0085] like Figure 3 As shown, after the initialization method of each graph node in each layer is determined, a three-layer stereoscopic structure is constructed according to the size and position of the information source area of each graph node in each layer.
[0086] Specifically, the first layer of the three-layer stereoscopic structure has only one graph node, the second layer has four graph nodes, and the third layer has nine graph nodes, wherein the graph nodes in each layer are arranged according to the position of the information acquisition area in the original feature map. For example, in the second layer, the four graph nodes whose information comes from the upper left, upper right, lower left, and lower right are placed in the upper left, upper right, lower left, and lower right of the second layer respectively; further, according to the spatial relationship of the graph nodes in the second layer, the connection between the graph nodes is divided into two parts: the first part is the connection between the graph nodes in the same layer (the connection between the graph nodes with the same information source area size), which specifically adopts the edge overlapping information extraction method and establishes the connection based on the covering relationship. Therefore, the connection method between the graph nodes in the same layer is to establish a connection between two graph nodes that are adjacent in spatial relationship (including upper, lower, left, right, and oblique edges); the second part is the connection between the graph nodes in different layers, and the connection between the graph nodes in different layers refers to the connection rules between the graph nodes in the same layer, specifically: a connection is established between two graph nodes whose information source areas of the graph nodes between the upper and lower layers overlap each other, which is manifested in this embodiment as each graph node being connected to all the graph nodes in the upper and lower layers.
[0087] S2035. According to the three-layer feature matrix, reorganize to obtain the adjacency matrix in the graph convolutional network.
[0088] After obtaining the initialization parameters of the graph nodes of each layer, the three-layer feature matrix is arranged in sequence and reorganized into an adjacency matrix to obtain the initialization parameters of the graph nodes of the entire graph convolutional network (GCN). The specific formula is as follows:
[0089] A=Ψ(f matrix-1,f matrix-2 ,f matrix-3 )
[0090] Among them, A represents the adjacency matrix in the graph convolutional network, Ψ represents the method of reshaping the feature matrix, and f matrix-1 ,f matrix-2 ,f matrix-3 Represent the feature matrices extracted from the three levels respectively.
[0091] The initialization parameters of each graph node in this embodiment are the size and position of the information source area of each graph node.
[0092] S2036. Based on the adjacency matrix in the graph convolutional network, a graph convolutional layer in the graph convolutional network is used to perform information interaction and fusion.
[0093] Based on the adjacency matrix obtained in step S2035, only one graph convolution layer in the graph convolution network is used to perform information interaction and fusion on adjacent graph nodes in the graph convolution network. The specific formula is as follows:
[0094]
[0095] in, A represents the adjacency matrix in the graph convolutional network, X represents the feature matrix composed of the feature vectors of all graph nodes, and W represents the weight of the graph convolutional network.
[0096] The adjacent graph nodes in this embodiment include adjacent graph nodes in the same layer and graph nodes connected in different layers.
[0097] In order to avoid adding too many parameters, this embodiment only uses one graph convolution layer for information interaction fusion; the graph convolution network after completing the information interaction fusion can identify more feature information.
[0098] S204, using the features after global-local information interaction to perform classification, and obtaining the identity label corresponding to the current cow face.
[0099] After the cow face image has gone through the above steps S201 to S203, first, a reconstructed feature vector is extracted from each graph node, 1 reconstructed feature vector is extracted from the first layer, 4 reconstructed feature vectors are extracted from the second layer, and 9 reconstructed feature vectors are extracted from the third layer; second, in order to make the total dimensions of the feature vectors extracted from different layers close, the feature vectors extracted from each layer are mapped to another feature dimension through a fully connected layer, so that the feature vectors of the same layer are concatenated to be close to 2048 dimensions, which is used as a feature fusion method; third, the fused feature vectors obtained from each layer are classified using a fully connected layer to obtain the classification scores of each layer, and then the classification scores of each layer are added together to obtain the final classification score; finally, the identity corresponding to the current cow face is obtained according to the final classification score.
[0100] This embodiment performs a performance test on the graph convolutional network after completing information interaction and fusion, as follows:
[0101] The performance test results are shown in Table 1. The first column in the table indicates the usage method, and the second column in the table indicates the accuracy of the corresponding method in recognizing cow faces. The baseline in the table indicates the benchmark method, with an accuracy of 94.256%. The layer1+layer2+layer3 in the table indicates that the graph convolutional network after information interaction fusion in this embodiment is used to recognize cow face images, with an accuracy of 97.342%. It can be seen that the graph convolutional network after information interaction fusion in this embodiment has excellent recognition performance.
[0102] Table 1 Performance test results of graph convolutional network after completing information interaction fusion
[0103]
[0104] Those skilled in the art will appreciate that all or part of the steps in the method for implementing the above embodiments may be completed by instructing related hardware through a program, and the corresponding program may be stored in a computer-readable storage medium.
[0105] It should be noted that although the method operations of the above embodiments are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted can be performed in a different order. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.
[0106] Embodiment 2:
[0107] like Figure 4 As shown, this embodiment provides a cow face recognition system based on a graph convolutional network model, which includes an acquisition unit 401, a first feature extraction unit 402, a second feature extraction unit 403 and a classification unit 404. The specific functions of each unit are as follows:
[0108] An acquisition unit 401 is used to acquire a cow face image;
[0109] A first feature extraction unit 402 is used to perform preliminary feature extraction on the cow face image using a feature extraction network to obtain an original feature map;
[0110] The second feature extraction unit 403 is used to perform multi-scale and multi-level feature division based on the original feature map and initialize the nodes of the graph convolution network, and use the graph convolution network to perform multi-scale and multi-level global-local information interaction to achieve further feature extraction;
[0111] The classification unit 404 is used to perform classification using the features after global-local information interaction to obtain the identity label corresponding to the current cow face.
[0112] The specific implementation of each unit in this embodiment can refer to the above-mentioned embodiment 1, and will not be described one by one here; it should be noted that the system provided in this embodiment is only illustrated by the division of the above-mentioned functional units. In actual applications, the above-mentioned functions can be assigned to different functional units as needed, that is, the internal structure can be divided into different functional units to complete all or part of the functions described above.
[0113] Embodiment 3:
[0114] like Figure 5 As shown, this embodiment provides a computer device, which includes a processor 502, a memory, an input device 503, a display device 504 and a network interface 505 connected through a system bus 501. Among them, the processor 502 is used to provide computing and control capabilities, the memory includes a non-volatile storage medium 506 and an internal memory 507, the non-volatile storage medium 506 stores an operating system, a computer program and a database, and the internal memory 507 provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium 506. When the computer program is executed by the processor 502, the cow face recognition method of the above-mentioned embodiment 1 is implemented as follows:
[0115] Get the cow face image;
[0116] Use the feature extraction network to perform preliminary feature extraction on the cow face image to obtain the original feature map;
[0117] Based on the original feature map, multi-scale and multi-level feature division is performed and the nodes of the graph convolutional network are initialized. The graph convolutional network is used to perform multi-scale and multi-level global-local information interaction to achieve further feature extraction.
[0118] The features after global-local information interaction are used for classification to obtain the identity corresponding to the current cow face.
[0119] Embodiment 4:
[0120] This embodiment provides a storage medium, which is a computer-readable storage medium, storing a computer program. When the computer program is executed by a processor, the cow face recognition method of the above embodiment 1 is implemented as follows:
[0121] Get the cow face image;
[0122] Use the feature extraction network to perform preliminary feature extraction on the cow face image to obtain the original feature map;
[0123] Based on the original feature map, multi-scale and multi-level feature division is performed and the nodes of the graph convolutional network are initialized. The graph convolutional network is used to perform multi-scale and multi-level global-local information interaction to achieve further feature extraction.
[0124] The features after global-local information interaction are used for classification to obtain the identity corresponding to the current cow face.
[0125] In summary, the present invention uses a graph convolutional network to perform multi-level and multi-scale global-local information interaction on the extracted original features, effectively integrating the global-local information of the cow face image, thereby significantly improving the accuracy of cow face recognition.
[0126] The above is only a preferred embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solution and inventive concept of the present invention within the scope disclosed by the present invention, which shall fall within the protection scope of the present invention.
Claims
1. A cow face recognition method based on a graph convolutional network model, characterized in that: The method comprises: Get the cow face image; Use the feature extraction network to perform preliminary feature extraction on the cow face image to obtain the original feature map; Based on the original feature map, multi-scale and multi-level feature division is performed and the nodes of the graph convolutional network are initialized. The graph convolutional network is used to perform multi-scale and multi-level global-local information interaction to achieve further feature extraction. Use the features after global-local information interaction to classify and obtain the identity corresponding to the current cow face; Based on the original feature map, multi-scale and multi-level feature division is performed and nodes of the graph convolution network are initialized, and the graph convolution network is used to perform multi-scale and multi-level global-local information interaction, specifically including: Based on the original feature graph, a three-layer graph is constructed as the graph structure in the graph convolutional network; Based on the three-layer structure graph, the original feature map is converted into a three-layer feature matrix using pooling operations of different sizes; Use the three-layer feature matrix to initialize the graph nodes of the corresponding layer, and obtain the size and position of the information source area of each graph node in each layer; According to the size and position of the information source area of each layer of each graph node, a three-layer stereoscopic structure is constructed; According to the three-layer feature matrix, the adjacency matrix in the graph convolutional network is reorganized; Based on the adjacency matrix in the graph convolutional network, a graph convolutional layer in the graph convolutional network is used to perform information interaction and fusion; The three-layer structure-based graph uses pooling operations of different sizes to convert the original feature map into a three-layer feature matrix, as shown in the following formula: f matrix-i =φ i (f I ) Among them, f matrix-i represents the feature matrix of the i-th layer, with a size of n×m, where n represents the number of graph nodes in the i-th layer, m represents the number of channels in the original feature graph, and f I represents the original feature map, φ i Indicates that the i-th layer uses the corresponding pooling operation from f I The operation of extracting eigenvectors and arranging them into a feature matrix; The i-th layer uses the corresponding layer pooling operation from f I The operations of extracting eigenvectors and arranging them into a feature matrix include: Use the corresponding pooling kernel to extract the i×i×C feature map from the original feature map; The i×i×C feature map is reorganized into a feature matrix with i×i rows and C columns, where i represents the corresponding layer number and C represents the number of channels of the original feature map.
2. The cow face recognition method according to claim 1, characterized in that: In the three-layer stereoscopic structure, the first layer has one graph node, the second layer has four graph nodes, and the third layer has nine graph nodes; The graph nodes in each layer are arranged according to the position of the information acquisition area in the original feature map; adjacent graph nodes in the same layer and adjacent graph nodes in different layers use edge overlapping information extraction method, and establish connections based on the coverage relationship.
3. The cow face recognition method according to claim 1, characterized in that: According to the three-layer feature matrix, the adjacency matrix in the graph convolutional network is reorganized as follows: A=Ψ(f matrix-1 ,f matrix-2 ,f matrix-3 ) Among them, A represents the adjacency matrix in the graph convolutional network, Ψ represents the method of reshaping the feature matrix, and f matrix-1 ,f matrix-2 ,f matrix-3 Represent the feature matrices extracted from the three levels respectively.
4. The cow face recognition method according to claim 1, characterized in that: Based on the adjacency matrix in the graph convolutional network, a graph convolutional layer in the graph convolutional network is used to perform information interaction fusion, as shown in the following formula: in, A represents the adjacency matrix in the graph convolutional network, X represents the feature matrix composed of the feature vectors of all graph nodes, and W represents the weight of the graph convolutional network.
5. The cow face recognition method according to any one of claims 1 to 4, characterized in that: The feature extraction network selects the first 41 layers of ResNet50; The feature extraction network is used to perform preliminary feature extraction on the cow face image to obtain the original feature map, which is as follows: The cow face image is input into the feature extraction network to obtain the original feature map of size W×H×C, where W represents width, H represents height and C represents the number of channels.
6. A cow face recognition system based on a graph convolutional network model, characterized in that: The system comprises: An acquisition unit, used for acquiring a cow face image; A first feature extraction unit is used to perform preliminary feature extraction on the cow face image using a feature extraction network to obtain an original feature map; The second feature extraction unit is used to perform multi-scale and multi-level feature division based on the original feature map and initialize the nodes of the graph convolution network, and use the graph convolution network to perform multi-scale and multi-level global-local information interaction to achieve further feature extraction; A classification unit is used to classify the features after global-local information interaction to obtain the identity of the current cow face; Based on the original feature map, multi-scale and multi-level feature division is performed and nodes of the graph convolution network are initialized, and the graph convolution network is used to perform multi-scale and multi-level global-local information interaction, specifically including: Based on the original feature graph, a three-layer graph is constructed as the graph structure in the graph convolutional network; Based on the three-layer structure graph, the original feature map is converted into a three-layer feature matrix using pooling operations of different sizes; Use the three-layer feature matrix to initialize the graph nodes of the corresponding layer, and obtain the size and position of the information source area of each graph node in each layer; According to the size and position of the information source area of each layer of each graph node, a three-layer stereoscopic structure is constructed; According to the three-layer feature matrix, the adjacency matrix in the graph convolutional network is reorganized; Based on the adjacency matrix in the graph convolutional network, a graph convolutional layer in the graph convolutional network is used to perform information interaction and fusion; The three-layer structure-based graph uses pooling operations of different sizes to convert the original feature map into a three-layer feature matrix, as shown in the following formula: f matrix-i =φ i (f I ) Among them, f matrix-i represents the feature matrix of the i-th layer, with a size of n×m, where n represents the number of graph nodes in the i-th layer, m represents the number of channels in the original feature graph, and f I represents the original feature map, φ i Indicates that the i-th layer uses the corresponding pooling operation from f I The operation of extracting eigenvectors and arranging them into a feature matrix; The i-th layer uses the corresponding layer pooling operation from f I The operations of extracting eigenvectors and arranging them into a feature matrix include: Use the corresponding pooling kernel to extract the i×i×C feature map from the original feature map; The i×i×C feature map is reorganized into a feature matrix with i×i rows and C columns, where i represents the corresponding layer number and C represents the number of channels of the original feature map.
7. A computer device comprising a processor and a memory for storing a program executable by the processor, characterized in that: When the processor executes the program stored in the memory, the cow face recognition method described in any one of claims 1 to 5 is implemented.
8. A storage medium storing a program, characterized in that: When the program is executed by a processor, the cow face recognition method described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Three-dimensional human body posture estimation method based on graph convolution network
CN112712019A
Deep learning-based cow face re-recognition method, system and device, and medium
CN113989836A