A method and device for recognizing a cow face based on artificial intelligence

By employing an AI-based cow face recognition method, utilizing weighted texture denoising, image enhancement, and edge fitting techniques, the method extracts features of spots, bones, and horns from the cow's face, solving the problem of low accuracy in cow face recognition and achieving higher recognition precision and efficiency.

CN116884031BActive Publication Date: 2025-12-19INSTITUTE OF GRASSLAND RESEARCH OF CAAS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310673190.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-07
Publication Date
2025-12-19
Estimated Expiration
2043-06-07

AI Technical Summary

Technical Problem

The existing cattle ear tag recognition technology has a problem that it cannot effectively solve in cattle facial recognition technology. The accuracy of the recognition is low. It is affected by factors such as reflection, angle and blurry movement, which makes it difficult for the computer to capture clear ear tag images, resulting in low recognition accuracy.

Method used

An AI-based cow face recognition method is adopted. By acquiring real-time cow face image sets, weighted texture denoising, image enhancement and normalization operations are performed. The structural recursive refinement algorithm is used for edge fitting and image segmentation to extract spot, bone and cow horn features. Standard cow face features are obtained through modality fusion. Finally, a pre-trained cow face recognition model is used for recognition.

Benefits of technology

It improves the accuracy and precision of cow face recognition, overcomes the influence of body hair noise, preserves detailed features of the cow face, improves the accuracy of feature extraction and recognition efficiency, and ensures the precision of cow face recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116884031B_ABST
    Figure CN116884031B_ABST
Patent Text Reader

Abstract

The application relates to the field of biometric identification, and discloses a cattle face recognition method based on artificial intelligence, which comprises the following steps: performing weight texture denoising, picture enhancement and picture standardization operations on real-time cattle face pictures in sequence to obtain a standard cattle face picture group; performing edge fitting operation on the standard cattle face picture group to obtain a standard cattle face contour group; performing picture segmentation on the standard cattle face picture group by using the standard cattle face contour group to obtain an interesting cattle face picture group; extracting cattle face structure features and cattle face texture features corresponding to the interesting cattle face picture group in sequence; performing modal fusion on the cattle face structure features and the cattle face texture features to obtain standard cattle face features; and calculating the cattle face number corresponding to the standard cattle face features by using a pre-trained cattle face recognition model. The application further discloses a cattle face recognition device based on artificial intelligence. The application can improve the accuracy of cattle face recognition.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of biometric identification, and particularly relates to a method and device for cow face recognition based on artificial intelligence. BACKGROUND

[0002] With the development and progress of science and technology, intelligent breeding has become a new darling of the breeding industry. In the cow breeding industry, the behavior of the cattle needs to be monitored in real time, and the health of the cattle needs to be judged. In order to realize the specific management of the cattle, the face of the cattle needs to be recognized.

[0003] The existing cow face recognition technology is mostly based on ear tag recognition method, that is, the identity of the cow is confirmed by the label with unique identification marked on the ear of the cow. In actual application, due to the influence of factors such as reflection, angle and action blur, the computer is difficult to collect clear ear tag pictures, so the representativeness of the ear tag features is poor, which may result in low accuracy in face recognition of the cattle. SUMMARY

[0004] The present application provides a method and device for cow face recognition based on artificial intelligence, which mainly aims to solve the problem of low accuracy in face recognition of the cattle.

[0005] To achieve the above purpose, the present application provides a method for cow face recognition based on artificial intelligence, which comprises:

[0006] Obtain a real-time cow face picture group, and sequentially perform weight texture denoising, picture enhancement and picture standardization operations on the real-time cow face picture group to obtain a standard cow face picture group, wherein the sequentially performing weight texture denoising, picture enhancement and picture standardization operations on the real-time cow face picture group to obtain a standard cow face picture group comprises: selecting each real-time cow face picture in the real-time cow face picture group as a target real-time cow face picture, and using a preset denoising window to slide through each pixel of the target real-time cow face picture, and taking the picture block corresponding to the denoising window as a target cow face picture block; and calculating the texture weight of the target cow face picture block by using the following texture weight algorithm:

[0007]

[0008] Wherein, W refers to the texture weight, m is the pixel length of the target cow face picture block, n is the pixel width of the target cow face picture block, i refers to the ith pixel in the horizontal direction of the target cow face picture block, j refers to the jth pixel in the vertical direction of the target cow face picture block, G is the gray symbol, and δ is a preset weight coefficient. (x+i,y+j) G is the gray value of the pixel with coordinates (x+i, y+j) in the target cow face picture block. (x,y)is a gray value of a pixel with a coordinate point (x, y) in the target cow face patch; performing multi-level denoising filtering on each target cow face patch in the target real-time cow face picture according to the texture weight to obtain a target denoised cow face picture; sequentially performing gray scale enhancement and contrast enhancement operations on the target denoised cow face picture to obtain a target enhanced cow face picture; performing picture stretching on the target denoised cow face picture according to a preset picture size to obtain a standard cow face picture, and collecting all the standard cow face pictures into a standard cow face group;

[0009] performing edge fitting operations on the standard cow face group by using a structure recursive refinement algorithm to obtain a standard cow face contour group, and performing picture segmentation on the standard cow face group by using the standard cow face contour group to obtain an interest cow face group;

[0010] sequentially extracting spot features, skeletal features and horn features corresponding to the interest cow face group, and splicing the spot features, the skeletal features and the horn features into cow face structure features;

[0011] extracting a noseprint patch group, a cow eye patch group and an earprint patch group from the interest cow face group respectively, extracting noseprint features corresponding to the noseprint patch group, cow eye features corresponding to the cow eye patch group and earprint features corresponding to the earprint patch group by using a granularity decomposition feature algorithm respectively, and splicing the noseprint features, the cow eye features and the earprint features into cow face texture features;

[0012] performing modal fusion on the cow face structure features and the cow face texture features to obtain standard cow face features, calculating a cow face number corresponding to the standard cow face features by using a pre-trained cow face recognition model, and ending cow face recognition.

[0013] Optionally, the performing edge fitting operations on the standard cow face group by using a structure recursive refinement algorithm to obtain a standard cow face contour group comprises:

[0014] selecting pictures in the standard cow face group as target standard cow face pictures one by one, performing edge detection on the target standard cow face pictures to obtain a primary cow face edge group;

[0015] performing line segment connection on the primary cow face edge group to obtain a primary cow face contour;

[0016] performing edge fitting on the primary cow face contour to obtain a secondary cow face contour;

[0017] performing edge refinement on the secondary cow face contour by using a structure recursive refinement algorithm as follows to obtain a standard cow face contour, and collecting all the standard cow face contours into a standard cow face contour group:

[0018] B(t) = (1-t)2 xP0+ 2x(l-t)x t x P1+ t 2 xP2

[0019] Wherein, B(t) refers to a point at t position on a segment of the contour curve in the secondary cow face contour, t is a position coefficient point of the contour curve, the value range of t is [0, 1], P0 refers to the starting point of the contour curve, P1 refers to the midpoint of the contour curve, and P2 refers to the terminal point of the contour curve.

[0020] Optionally, the picture segmentation of the standard cow face picture group by using the standard cow face contour group to obtain the interest cow face picture group comprises:

[0021] Select a standard cow face contour in the standard cow face contour group as a target standard cow face contour, and select a standard cow face picture corresponding to the target standard cow face contour in the standard cow face picture group as a target standard cow face picture;

[0022] Generate a target contour mask according to the target standard cow face contour;

[0023] Perform a mask cropping operation on the target standard cow face picture by using the target contour mask to obtain an interest cow face picture, and collect all the interest cow face pictures into an interest cow face picture group.

[0024] Optionally, the spot feature, the skeleton feature and the horn feature corresponding to the interest cow face picture group are extracted in sequence, comprising:

[0025] Select an interest cow face picture in the interest cow face picture group as a target interest cow face picture, and extract a cow face spot block corresponding to the target interest cow face picture by using a gray scale detection algorithm;

[0026] Calculate a spot proportion, a spot centroid and a spot distance of the cow face spot block, and take the spot proportion, the spot centroid and the spot distance as a target spot feature;

[0027] Extract a cow face eye socket block, a cow face nose bridge block and a cow face horn block from the target interest cow face picture respectively;

[0028] Calculate a cow eye distance corresponding to the cow face eye socket block, a nose bridge proportion corresponding to the cow face nose bridge block, and an eye-nose centroid corresponding to the cow face eye socket block and the cow face nose bridge block respectively;

[0029] Take the cow eye distance, the nose bridge proportion and the eye-nose centroid as a target skeleton feature;

[0030] extracting a horn angle, a horn contour and a horn distance corresponding to the cow horn patch in the target interest cow face picture respectively, and taking the horn angle, the horn contour and the horn distance as target horn features;

[0031] taking a mean vector of all the target spot features as spot features, a mean vector of all the target skeleton features as skeleton features, and a mean vector of all the target horn features as horn features.

[0032] Optionally, the extracting the cow face eye socket patch, the cow face nose bridge patch and the cow horn patch from the target interest cow face picture respectively comprises:

[0033] sequentially performing multi-level convolution and multi-level pooling on the target interest cow face picture to obtain an interest cow face feature map;

[0034] sequentially performing convolution and full connection operations on the interest cow face feature map to obtain a bounding box group;

[0035] performing a non-maximum suppression operation on the bounding box group to obtain a standard bounding box group;

[0036] extracting a cow face eye socket bounding box, a cow face nose bridge bounding box and a cow horn bounding box from the standard bounding box group according to a category probability corresponding to each standard bounding box in the standard bounding box group respectively;

[0037] taking a patch corresponding to the cow face eye socket bounding box in the target interest cow face picture as a cow face eye socket patch;

[0038] taking a patch corresponding to the cow face nose bridge bounding box in the target interest cow face picture as a cow face nose bridge patch;

[0039] taking a patch corresponding to the cow horn bounding box in the target interest cow face picture as a cow horn patch.

[0040] Optionally, the extracting the noseprint feature corresponding to the noseprint patch group, the cow eye feature corresponding to the cow eye patch group and the earprint feature corresponding to the earprint patch group using the granularity decomposition feature algorithm comprises:

[0041] sequentially performing uniform segmentation, feature extraction, weighted feature aggregation, random down-sampling and feature mean extraction operations on the noseprint patch group to obtain a noseprint feature;

[0042] sequentially performing uniform segmentation, feature extraction, weighted feature aggregation, random down-sampling and feature mean extraction operations on the cow eye patch group to obtain a cow eye feature;

[0043] The ear print features are obtained by sequentially performing uniform segmentation, feature extraction, weighted feature aggregation, random downsampling, and feature mean extraction on the ear print patch group.

[0044] Optionally, the step of sequentially performing uniform segmentation, feature extraction, weighted feature aggregation, random downsampling, and feature mean extraction on the nasal print patch group to obtain nasal print features includes:

[0045] Each nasal print patch in the nasal print patch group is selected as a target nasal print patch, and the target nasal print patch is uniformly divided to obtain a target nasal print granularity map group.

[0046] Perform a convolution operation on the target nasal texture granularity map group to obtain the target nasal texture granularity feature group;

[0047] Perform a weighted feature aggregation operation on the target nasal print granularity feature group to obtain the target weighted nasal print feature group;

[0048] Random downsampling is performed on the target weighted nasal print feature group to obtain the target nasal print features, and the mean vector of all target nasal print features is used as the nasal print features.

[0049] Optionally, the modal fusion of the cow face structural features and the cow face texture features to obtain standard cow face features includes:

[0050] The cow-face structural features are reduced in dimension and sampled into standard structural features using a preset global pooling layer;

[0051] The global pooling layer is used to downsample the cow face texture features into standard texture features;

[0052] The structural attention weights corresponding to the standard structural features and the texture attention weights corresponding to the standard texture features are calculated using a self-attention mechanism.

[0053] Based on the structural attention weight and the texture attention weight, the standard texture features and the standard structural features are weighted and fused to obtain the standard cow face features.

[0054] Optionally, the step of calculating the cow face number corresponding to the standard cow face features using a pre-trained cow face recognition model, and ending the cow face recognition, includes:

[0055] The standard cow face features are downsampled using a pre-trained cow face recognition model to obtain dimensionality-reduced cow face features;

[0056] The reduced-dimensional cow face features are normalized using the cow face recognition model to obtain the cow face feature code.

[0057] In the cow face number library of the cow face recognition model, the cow face feature code corresponding cow face number is queried out.

[0058] To solve the above problems, the application also provides a cow face recognition device based on artificial intelligence, which comprises:

[0059] A picture enhancement module is configured to obtain a real-time cow face picture group, sequentially perform weight texture denoising, picture enhancement and picture normalization operations on the real-time cow face picture group, and obtain a standard cow face picture group. The sequentially performing weight texture denoising, picture enhancement and picture normalization operations on the real-time cow face picture group to obtain the standard cow face picture group comprises: selecting each real-time cow face picture in the real-time cow face picture group as a target real-time cow face picture, performing sliding on the target real-time cow face picture pixel by pixel using a preset denoising window, and taking a picture block corresponding to the denoising window as a target cow face picture block; and calculating the texture weight of the target cow face picture block using a texture weight algorithm as follows:

[0060]

[0061] wherein W represents the texture weight, m represents the pixel length of the target cow face picture block, n represents the pixel width of the target cow face picture block, i represents the ith pixel in the target cow face picture block in the horizontal direction, j represents the jth pixel in the target cow face picture block in the vertical direction, G represents a gray scale symbol, and δ represents a preset weight coefficient. G (x+i,y+j) represents the gray scale value of the pixel with the coordinate point (x+i, y+j) in the target cow face picture block, and G (x,y) represents the gray scale value of the pixel with the coordinate point (x, y) in the target cow face picture block. Each target cow face picture block in the target real-time cow face picture is subjected to multi-level denoising filtering according to the texture weight to obtain a target denoising cow face picture. The target denoising cow face picture is sequentially subjected to gray scale enhancement and contrast enhancement operations to obtain a target enhanced cow face picture. The target denoising cow face picture is subjected to picture stretching operation according to a preset picture size to obtain a standard cow face picture, and all the standard cow face pictures are collected into a standard cow face picture group.

[0062] A picture segmentation module is configured to perform edge fitting operation on the standard cow face picture group using a structure recursive refinement algorithm to obtain a standard cow face contour group, and perform picture segmentation on the standard cow face picture group using the standard cow face contour group to obtain an interest cow face picture group.

[0063] A structure extraction module is configured to sequentially extract spot features, skeletal features and horn features corresponding to the interest cow face picture group, and splice the spot features, the skeletal features and the horn features into cow face structure features.

[0064] a texture extraction module configured to extract a nose texture block group, an eye texture block group and an ear texture block group from the interest cattle face image group respectively, extract nose texture features corresponding to the nose texture block group, eye texture features corresponding to the eye texture block group and ear texture features corresponding to the ear texture block group by using a granularity decomposition feature algorithm, and splice the nose texture features, the eye texture features and the ear texture features into cattle face texture features;

[0065] a cattle face recognition module configured to perform modal fusion on the cattle face structure features and the cattle face texture features to obtain standard cattle face features, calculate cattle face numbers corresponding to the standard cattle face features by using a pre-trained cattle face recognition model, and end cattle face recognition.

[0066] The embodiment of the present application can prevent detail loss caused by a single cattle face image by obtaining a real-time cattle face image group, can retain more cattle face detail features by performing weight texture denoising, image enhancement and image standardization operations on the real-time cattle face image group in sequence to obtain a standard cattle face image group, can improve the accuracy of cattle face recognition, can overcome face noise caused by body hair on the cattle face by performing edge fitting on the standard cattle face image group by using a structure recursive refinement algorithm to obtain a standard cattle face contour group, can obtain more accurate cattle face contours, can improve the accuracy of subsequent cattle face structure features, can facilitate subsequent feature extraction by performing image segmentation on the standard cattle face image group by using the standard cattle face contour group to obtain an interest cattle face image group, can improve the representation degree of cattle face structure features by extracting spot features, skeleton features and horn features corresponding to the interest cattle face image group in sequence and splicing the spot features, the skeleton features and the horn features into cattle face structure features, can extract more structure features between cattle face skeletons, and can further improve the accuracy of subsequent cattle face recognition.

[0067] By respectively extracting a noseprint block group, a cattle eye block group and an earprint block group from the interest cattle face image group, using a granularity decomposition feature algorithm to respectively extract noseprint features corresponding to the noseprint block group, cattle eye features corresponding to the cattle eye block group and earprint features corresponding to the earprint block group, features with a relatively large proportion in regional features can be retained, and the accuracy of feature recognition is improved. By splicing the noseprint features, the cattle eye features and the earprint features into cattle face texture features, the feature dimension of the texture features is improved, and the accuracy of cattle face recognition is improved. By modal fusion of the cattle face structure features and the cattle face texture features, standard cattle face features are obtained, the feature details of the cattle face texture features and the cattle face structure features are retained, the feature dimension is reduced, the efficiency of cattle face recognition is improved, and the accuracy of cattle face recognition is ensured by using a pre-trained cattle face recognition model to calculate cattle face numbers corresponding to the standard cattle face features. Therefore, the cattle face recognition method and device based on artificial intelligence provided by the present application can solve the problem of low accuracy of cattle face recognition. BRIEF DESCRIPTION OF DRAWINGS

[0068] Figure 1 A flowchart of a cattle face recognition method based on artificial intelligence provided by an embodiment of the present application is shown.

[0069] Figure 2 A flowchart of extracting spot features, skeleton features and cattle horn features provided by an embodiment of the present application is shown.

[0070] Figure 3 A flowchart of extracting noseprint features provided by an embodiment of the present application is shown.

[0071] Figure 4 A functional module diagram of a cattle face recognition device based on artificial intelligence provided by an embodiment of the present application is shown.

[0072] The implementation, functional characteristics and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

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

[0074] The embodiment of the present application provides a cow face recognition method based on artificial intelligence. The execution subject of the cow face recognition method based on artificial intelligence includes but is not limited to at least one of electronic devices capable of being configured to execute the method provided by the embodiment of the present application, such as a server, a terminal and the like. In other words, the cow face recognition method based on artificial intelligence can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to a single server, a server cluster, a cloud server or a cloud server cluster and the like. The server can be a stand-alone server, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms.

[0075] Referring to Figure 1 Fig. 1 is a flowchart of a cow face recognition method based on artificial intelligence provided by an embodiment of the present application. In the embodiment, the cow face recognition method based on artificial intelligence includes:

[0076] S1, acquiring a real-time cow face image group, sequentially performing weight texture denoising, picture enhancement and picture standardization operations on the real-time cow face image group to obtain a standard cow face image group.

[0077] In the embodiment of the present application, the real-time cow face image group is a group of cow face images obtained by continuously photographing the cow face to be recognized by a camera device, and the photographed cow face in the real-time cow face image group is the face of the same cow.

[0078] In the embodiment of the present application, the sequentially performing weight texture denoising, picture enhancement and picture standardization operations on the real-time cow face image group to obtain a standard cow face image group includes:

[0079] Selecting each real-time cow face image in the real-time cow face image group as a target real-time cow face image, and sliding the target real-time cow face image pixel by pixel using a preset denoising window, taking the image block corresponding to the denoising window as a target cow face image block;

[0080] The texture weight of the target cow face image block is calculated by using the following texture weight algorithm:

[0081]

[0082] Wherein, W refers to the texture weight, m is the pixel length of the target cow face block, n is the pixel width of the target cow face block, i refers to the ith pixel in the horizontal direction in the target cow face block, j refers to the jth pixel in the vertical direction in the target cow face block, G is a gray symbol, and delta is a preset weight coefficient. (x+i,y+j) Refers to the gray value of the pixel with the coordinate point (x+i, y+j) in the target cow face block. (x,y) Refers to the gray value of the pixel with the coordinate point (x, y) in the target cow face block.

[0083] According to the texture weight, each target cow face block in the target real-time cow face picture is subjected to multi-stage denoising filtering, and a target denoised cow face picture is obtained.

[0084] The target denoised cow face picture is sequentially subjected to gray enhancement and contrast enhancement operations, and a target enhanced cow face picture is obtained.

[0085] The target denoised cow face picture is subjected to picture stretching operation according to a preset picture size, and a standard cow face picture is obtained.

[0086] In detail, the denoising window refers to a picture extraction window with a fixed size, and the texture weight of the target cow face block is calculated by using the texture weight algorithm, so that the noise size of the picture can be determined according to the picture gray gradient in each denoising window, and the picture is denoised in a region, and more texture details of the picture are retained.

[0087] In detail, the target denoised cow face picture can be subjected to gray enhancement by using a linear transformation or histogram equalization algorithm, and the target denoised cow face picture can be subjected to contrast enhancement by using a histogram stretching algorithm or an adaptive contrast enhancement method.

[0088] In the embodiment of the application, by acquiring a real-time cow face group, detail loss caused by a cow face picture can be prevented, by sequentially performing weight texture denoising, picture enhancement and picture standardization operations on the real-time cow face group, a standard cow face group can be obtained, cow face detail features can be retained more, and the accuracy of cow face recognition can be improved.

[0089] S2, an edge fitting operation is performed on the standard cow face group by using a structure recursive refinement algorithm, a standard cow face contour group is obtained, and the standard cow face group is subjected to picture segmentation by using the standard cow face contour group, and an interest cow face group is obtained.

[0090] In the embodiment of the application, the edge fitting operation is performed on the standard cow face group by using the structure recursive refinement algorithm, and the standard cow face contour group is obtained, comprising:

[0091] selecting pictures in the standard cow face picture set one by one as target standard cow face pictures, performing edge detection on the target standard cow face pictures to obtain a primary cow face edge set;

[0092] performing line segment connection on the primary cow face edge set to obtain a primary cow face contour;

[0093] performing edge fitting on the primary cow face contour to obtain a secondary cow face contour;

[0094] performing edge refinement on the secondary cow face contour by using a structure recursive refinement algorithm to obtain a standard cow face contour, and collecting all the standard cow face contours into a standard cow face contour set:

[0095] B(t) = (1-t) 2 ×P0+2×(1-t)×t×P1+t 2 ×P2

[0096] wherein, B(t) refers to a point at position t on a contour curve in the secondary cow face contour, t is a position coefficient point of the contour curve, the value range of t is [0, 1], P0 refers to a starting point of the contour curve, P1 refers to a midpoint of the contour curve, and P2 refers to a terminal point of the contour curve.

[0097] Specifically, the target standard cow face pictures can be subjected to edge detection by using a sobel operator or a canny operator to obtain a primary cow face edge set, the primary cow face edge set can be subjected to line segment connection by using a Hough transform algorithm to obtain a primary cow face contour, and the primary cow face contour can be subjected to edge fitting by using a least square method or a random sample consensus (RANSAC) to obtain a secondary cow face contour.

[0098] In detail, by performing edge refinement on the secondary cow face contour by using the structure recursive refinement algorithm to obtain a standard cow face contour, the inaccurate or non-smooth part on the secondary cow face contour can be removed, so that a cow face contour with higher precision is obtained.

[0099] In detail, the use of the standard cow face contour set to perform picture segmentation on the standard cow face picture set to obtain an interesting cow face picture set comprises:

[0100] selecting a standard cow face contour in the standard cow face contour set one by one as a target standard cow face contour, and selecting a standard cow face picture corresponding to the target standard cow face contour in the standard cow face picture set as a target standard cow face picture;

[0101] generating a target contour mask according to the target standard cow face contour;

[0102] The target standard cow face picture is masked and cut using the target contour mask to obtain an interested cow face picture, and all interested cow face pictures are collected into an interested cow face group.

[0103] In detail, the target contour mask can be generated according to the target standard cow face contour by using a cv2.drawContours () function, and the target standard cow face picture is masked and cut using the target contour mask to obtain an interested cow face picture, which means that the target contour mask and the target standard cow face picture are subjected to a bitwise AND operation to obtain an interested cow face picture.

[0104] In the embodiment of the present application, the edge fitting operation is performed on the standard cow face group by using a structure recursive refinement algorithm to obtain a standard cow face contour group, which can overcome the noise of the face caused by the body hair of the cow face, and obtain a more accurate cow face contour, thereby improving the accuracy of the subsequent cow face structure feature, and the picture segmentation is performed on the standard cow face group by using the standard cow face contour group to obtain an interested cow face group, which can facilitate the subsequent feature extraction.

[0105] S3, the spot feature, the skeleton feature and the horn feature corresponding to the interested cow face group are extracted in turn, and the spot feature, the skeleton feature and the horn feature are spliced into a cow face structure feature.

[0106] In the embodiment of the present application, the spot feature refers to the distribution feature corresponding to the spot pattern on each cow face, the skeleton feature refers to the distribution structure feature of the eye socket, the bridge of the nose and the like on the cow face, and the horn feature refers to the shape, size and distribution position and the like of the horn structure feature.

[0107] In the embodiment of the present application, referring to Figure 2 As shown in the figure, the spot feature, the skeleton feature and the horn feature corresponding to the interested cow face group are extracted in turn, and the spot feature, the skeleton feature and the horn feature are spliced into a cow face structure feature.

[0108] S21, the interested cow face picture in the interested cow face group is selected as a target interested cow face picture one by one, and a gray scale detection algorithm is used to extract a cow face spot block corresponding to the target interested cow face picture.

[0109] S22, the spot proportion, the spot centroid and the spot distance of the cow face spot block are calculated respectively, and the spot proportion, the spot centroid and the spot distance are taken as a target spot feature.

[0110] S23, a cow face eye socket block, a cow face bridge of the nose block and a cow face horn block are extracted from the target interested cow face picture respectively.

[0111] S24, respectively calculate the cow eye distance corresponding to the cow face eye socket block, the nose bridge proportion corresponding to the cow face nose bridge block, and the eye-nose centroid corresponding to the cow face eye socket block and the cow face nose bridge block;

[0112] S25, take the cow eye distance, the nose bridge proportion, and the eye-nose centroid as target skeletal features;

[0113] S26, respectively extract the horn angle, horn contour, and horn distance corresponding to the cow face horn block, and take the horn angle, horn contour, and horn distance as target horn features;

[0114] S27, take the mean vector of all target spot features as spot features, the mean vector of all target skeletal features as skeletal features, and the mean vector of all target horn features as horn features.

[0115] In detail, the gray scale detection algorithm can be a binary algorithm or a connected region analysis algorithm, the spot proportion refers to the proportion of the pixel area of the cow face spot block in the target interest cow face picture, the spot centroid can be calculated using the geometric mean method or the image moment algorithm, and the spot distance refers to the pixel distance between each spot in the cow face spot block.

[0116] Specifically, the method of respectively calculating the cow eye distance corresponding to the cow face eye socket block, the nose bridge proportion corresponding to the cow face nose bridge block, and the eye-nose centroid corresponding to the cow face eye socket block and the cow face nose bridge block is consistent with the method of respectively calculating the spot proportion, spot centroid, and spot distance of the cow face spot block, and taking the spot proportion, spot centroid, and spot distance as target spot features, which will not be repeated here.

[0117] In detail, the cow face eye socket block, the cow face nose bridge block, and the cow face horn block are respectively extracted from the target interest cow face picture, including:

[0118] Sequentially performing multi-level convolution and multi-level pooling on the target interest cow face picture to obtain an interest cow face feature map;

[0119] Sequentially performing convolution and full connection operations on the interest cow face feature map to obtain a bounding box group;

[0120] Performing a non-maximum suppression operation on the bounding box group to obtain a standard bounding box group;

[0121] According to the class probability corresponding to each standard bounding box in the standard bounding box group, respectively extracting a cow face eye socket bounding box, a cow face nose bridge bounding box, and a cow face horn bounding box from the standard bounding box group;

[0122] taking a patch corresponding to the boundary box of the eye socket of the cow face in the target cow face picture of interest as a cow face eye socket patch;

[0123] taking a patch corresponding to the boundary box of the nose bridge of the cow face in the target cow face picture of interest as a cow face nose bridge patch;

[0124] taking a patch corresponding to the boundary box of the horn of the cow face in the target cow face picture of interest as a cow face horn patch.

[0125] In detail, the YOLO model trained by a large number of cow face pictures labeled with eye socket boundary boxes, nose bridge boundary boxes and horn boundary boxes can be used to sequentially perform convolution and full connection operations on the cow face feature map of interest to obtain a boundary box group, and the boundary box group corresponds to the coordinates, length and width of the boundary box, target confidence score and class probability.

[0126] Specifically, the splicing of the spot feature, the skeleton feature and the horn feature into the cow face structure feature comprises:

[0127] dimensionality reduction sampling of the spot feature into a dimensionality reduction spot feature by using a preset global pooling layer;

[0128] dimensionality reduction sampling of the skeleton feature into a dimensionality reduction skeleton feature by using the global pooling layer;

[0129] dimensionality reduction sampling of the horn feature into a dimensionality reduction horn feature by using the global pooling layer;

[0130] respectively taking the dimensionality reduction spot feature, the dimensionality reduction skeleton feature and the dimensionality reduction horn feature as single-dimensional features for feature splicing to obtain a cow face structure feature.

[0131] In detail, the global pooling layer is a commonly used pooling operation in a deep learning neural network, which is commonly used in a convolutional neural network to summarize and compress the information of the entire feature map, and can down-sample the spot feature, the skeleton feature and the horn feature into features of the same dimension and the same length.

[0132] In the embodiment of the application, the spot feature, the skeleton feature and the horn feature corresponding to the cow face picture group of interest are sequentially extracted, the spot feature, the skeleton feature and the horn feature are spliced into a cow face structure feature, which can improve the representation degree of the cow face structure feature, extract more structure features between the cow face skeletons, and further improve the accuracy of subsequent cow face recognition.

[0133] S4, respectively, from the interest cow face picture group, extract the nose print block group, the cow eye block group and the ear print block group, respectively, using the granularity decomposition feature algorithm to extract the nose print feature corresponding to the nose print block group, the cow eye feature corresponding to the cow eye block group and the ear print feature corresponding to the ear print block group, and splicing the nose print feature, the cow eye feature and the ear print feature into the cow face texture feature.

[0134] In the embodiment of the present application, the nose print block group refers to the block group composed of the nose part corresponding to each cow face in the interest cow face picture group, the cow eye block group refers to the block group composed of the eye part corresponding to each cow face in the interest cow face picture group, and the ear print block group refers to the block group composed of the ear part corresponding to each cow face in the interest cow face picture group.

[0135] In the embodiment of the present application, the method of respectively extracting the nose print block group, the cow eye block group and the ear print block group from the interest cow face picture group is consistent with the method of respectively extracting the cow face eye socket block, the cow face nose bridge block and the cow face horn block from the target interest cow face picture in the above step S3, which will not be repeated here.

[0136] In the embodiment of the present application, the granularity decomposition feature algorithm is used to respectively extract the nose print feature corresponding to the nose print block group, the cow eye feature corresponding to the cow eye block group and the ear print feature corresponding to the ear print block group, which includes:

[0137] The nose print block group is uniformly divided, the feature is extracted, the weighted feature is aggregated, the random down-sampling is performed and the feature mean value is extracted in sequence to obtain the nose print feature;

[0138] The cow eye block group is uniformly divided, the feature is extracted, the weighted feature is aggregated, the random down-sampling is performed and the feature mean value is extracted in sequence to obtain the cow eye feature;

[0139] The ear print block group is uniformly divided, the feature is extracted, the weighted feature is aggregated, the random down-sampling is performed and the feature mean value is extracted in sequence to obtain the ear print feature.

[0140] In detail, the nose print feature, the cow eye feature and the ear print feature are the facial features with the most biological recognition characteristics in the cow face.

[0141] In detail, referring to Figure 3 As shown in the figure, the nose print block group is uniformly divided, the feature is extracted, the weighted feature is aggregated, the random down-sampling is performed and the feature mean value is extracted in sequence to obtain the nose print feature, which includes:

[0142] S31, select a noseprint block in the noseprint block group as a target noseprint block one by one, perform uniform segmentation on the target noseprint block, and obtain a target noseprint granularity block group;

[0143] S32, perform convolution operation on the target noseprint granularity block group, and obtain a target noseprint granularity feature group;

[0144] S33, perform weighted feature aggregation operation on the target noseprint granularity feature group, and obtain a target weighted noseprint feature group;

[0145] S34, perform random down-sampling operation on the target weighted noseprint feature group, and obtain a target noseprint feature, and take the mean vector of all target noseprint features as a noseprint feature.

[0146] Specifically, the weighted feature aggregation operation can be performed on the target noseprint granularity feature group by using a weighted summation algorithm, a weighted average algorithm or a maximum value pooling algorithm, and the convolution operation can be performed on the target noseprint granularity block group by using a Gabor filter or a Log-Gabor filter, so as to obtain the target noseprint granularity feature group.

[0147] Specifically, the method for splicing the noseprint feature, the cow eye feature and the earprint feature into a cow face texture feature is the same as the method for splicing the spot feature, the skeleton feature and the cow horn feature into a cow face structure feature in step S3, and details are not repeated here.

[0148] In the embodiment of the present application, the noseprint block group, the cow eye block group and the earprint block group are extracted from the interest cow face block group respectively, the noseprint feature corresponding to the noseprint block group, the cow eye feature corresponding to the cow eye block group and the earprint feature corresponding to the earprint block group are extracted by using a granularity decomposition feature algorithm, the features with a large proportion in the area feature can be reserved, and the accuracy of feature recognition is improved, the feature dimension of the texture feature is improved by splicing the noseprint feature, the cow eye feature and the earprint feature into a cow face texture feature, and the accuracy of cow face recognition is improved.

[0149] S5, modal fusion is performed on the cow face structure feature and the cow face texture feature to obtain a standard cow face feature, a cow face number corresponding to the standard cow face feature is calculated by using a pre-trained cow face recognition model, and the cow face recognition is ended.

[0150] In the embodiment of the present application, the modal fusion is performed on the cow face structure feature and the cow face texture feature to obtain a standard cow face feature, and the method comprises the following steps:

[0151] The cow face structure feature is dimensionally sampled into a standard structure feature by using a preset global pooling layer;

[0152] dimensionally sample the cow face texture feature into a standard texture feature by using the global pooling layer;

[0153] respectively calculate structure attention weights corresponding to the standard structure feature and texture attention weights corresponding to the standard texture feature by using a self-attention mechanism;

[0154] perform weighted feature fusion on the standard texture feature and the standard structure feature according to the structure attention weights and the texture attention weights, to obtain a standard cow face feature.

[0155] In detail, the self-attention mechanism is a mechanism for modeling the internal relationship of sequence data, and is commonly used in natural language processing and computer vision tasks. The weighted feature fusion of the standard texture feature and the standard structure feature according to the structure attention weights and the texture attention weights refers to multiplying the structure attention weights by the standard structure feature to obtain a weighted structure feature, multiplying the texture attention weights by the standard texture feature to obtain a weighted texture feature, and adding the weighted structure feature and the weighted texture feature to obtain a standard cow face feature.

[0156] Specifically, the cow face recognition model can be a support vector machine (SVM) or a VGG network model trained by using a large number of standard cow face features labeled with cow face numbers.

[0157] In detail, the calculation of the cow face number corresponding to the standard cow face feature by using the pre-trained cow face recognition model ends the cow face recognition, and includes:

[0158] perform downsampling operation on the standard cow face feature by using the pre-trained cow face recognition model, to obtain a dimensionally reduced cow face feature;

[0159] perform normalization operation on the dimensionally reduced cow face feature by using the cow face recognition model, to obtain a cow face feature code;

[0160] query the cow face number corresponding to the cow face feature code in a cow face number library of the cow face recognition model.

[0161] In detail, the downsampling operation on the standard cow face feature can be performed by using a linear discriminant analysis method or a principal component analysis method of the pre-trained cow face recognition model, to obtain a dimensionally reduced cow face feature. The normalization operation on the dimensionally reduced cow face feature can be performed by using a softmax normalization algorithm or a Z-score normalization algorithm of the cow face recognition model, to obtain a cow face feature code.

[0162] Specifically, the cow face number library is a database composed of a plurality of cow face numbers, and each cow face number corresponds to a range section of cow face feature code.

[0163] In the embodiment of the present application, by modal fusion of the cow face structure feature and the cow face texture feature, the standard cow face feature is obtained, which can retain the feature details of the cow face texture feature and the cow face structure feature while reducing the feature dimension, improving the efficiency of cow face recognition, and calculating the corresponding cow face number of the standard cow face feature by using the pre-trained cow face recognition model, which can ensure the accuracy of cow face recognition.

[0164] In the embodiment of the present application, by acquiring a real-time cow face picture group, the details missing caused by a cow face picture can be prevented, by sequentially performing weight texture denoising, picture enhancement and picture standardization operations on the real-time cow face picture group, a standard cow face picture group is obtained, which can retain more cow face detail features and improve the accuracy of cow face recognition, by using a structure recursive refinement algorithm to perform edge fitting operation on the standard cow face picture group, a standard cow face contour group is obtained, which can overcome the face noise caused by the body hair of the cow face and obtain more accurate cow face contour, thereby improving the accuracy of subsequent cow face structure features, by using the standard cow face contour group to perform picture segmentation on the standard cow face picture group, an interest cow face picture group is obtained, which can facilitate subsequent feature extraction, by sequentially extracting the spot feature, the skeleton feature and the horn feature corresponding to the interest cow face picture group, the spot feature, the skeleton feature and the horn feature are spliced into a cow face structure feature, which can improve the representation degree of the cow face structure feature and extract more structure features between the cow face skeletons, thereby improving the accuracy of subsequent cow face recognition.

[0165] By respectively extracting a noseprint picture block group, a cow eye picture block group and an earprint picture block group from the interest cow face picture group, using a granularity decomposition feature algorithm to respectively extract the noseprint feature corresponding to the noseprint picture block group, the cow eye feature corresponding to the cow eye picture block group and the earprint feature corresponding to the earprint picture block group, the features with a large proportion in the region feature can be retained, thereby improving the accuracy of feature recognition, by splicing the noseprint feature, the cow eye feature and the earprint feature into a cow face texture feature, the feature dimension of the texture feature can be improved, thereby improving the accuracy of cow face recognition, by modal fusion of the cow face structure feature and the cow face texture feature, the standard cow face feature is obtained, which can retain the feature details of the cow face texture feature and the cow face structure feature while reducing the feature dimension, improving the efficiency of cow face recognition, and calculating the corresponding cow face number of the standard cow face feature by using the pre-trained cow face recognition model, which can ensure the accuracy of cow face recognition. Therefore, the cow face recognition method based on artificial intelligence can solve the problem of low accuracy in face recognition of cattle.

[0166] As Figure 4 shown, it is an embodiment provided by the application Function module diagram of the cattle face recognition device based on artificial intelligence.

[0167] The cattle face recognition device based on artificial intelligence 100 can be installed in an electronic device. According to the function to be realized, the cattle face recognition device based on artificial intelligence 100 can include a picture enhancement module 101, a picture segmentation module 102, a structure extraction module 103, a texture extraction module 104 and a cattle face recognition module 105. The module of the application can also be called unit, which refers to a series of computer program segments that can be executed by the processor of the electronic device and can complete fixed functions, which are stored in the memory of the electronic device.

[0168] In this embodiment, the functions of each module / unit are as follows:

[0169] The picture enhancement module 101 is used to obtain a real-time cattle face picture group, and sequentially performs weight texture denoising, picture enhancement and picture normalization operations on the real-time cattle face picture group to obtain a standard cattle face picture group. Wherein, the sequentially performing weight texture denoising, picture enhancement and picture normalization operations on the real-time cattle face picture group to obtain a standard cattle face picture group comprises: selecting each real-time cattle face picture in the real-time cattle face picture group as a target real-time cattle face picture, and using a preset denoising window to slide pixel by pixel on the target real-time cattle face picture, and taking the picture block corresponding to the denoising window as a target cattle face picture block; the texture weight of the target cattle face picture block is calculated by using the following texture weight algorithm:

[0170]

[0171] Wherein, W refers to the texture weight, m is the pixel length of the target cattle face picture block, n is the pixel width of the target cattle face picture block, i refers to the ith pixel in the horizontal direction of the target cattle face picture block, j refers to the jth pixel in the vertical direction of the target cattle face picture block, G is the gray symbol, and δ is a preset weight coefficient. G (x+i,y+j) (x+i, y+j) in the target cattle face picture block, and G (x,y) (x, y) in the target cattle face picture block; according to the texture weight, each target cattle face picture block in the target real-time cattle face picture is subjected to multi-level denoising filtering to obtain a target denoising cattle face picture; the target denoising cattle face picture is sequentially subjected to gray scale enhancement and contrast enhancement operations to obtain a target enhanced cattle face picture; the target denoising cattle face picture is subjected to picture stretching operation according to a preset picture size to obtain a standard cattle face picture, and all standard cattle face pictures are collected into a standard cattle face picture group;

[0172] The image segmentation module 102 is used to perform edge fitting on the standard cow face image group using a structural recursive refinement algorithm to obtain a standard cow face contour group, and to perform image segmentation on the standard cow face image group using the standard cow face contour group to obtain an interest cow face image group.

[0173] The structure extraction module 103 is used to sequentially extract the spot features, bone features and horn features corresponding to the interest cow face image group, and splice the spot features, bone features and horn features into cow face structure features;

[0174] The texture extraction module 104 is used to extract the nose texture patch group, the bull eye patch group, and the ear texture patch group from the interest bull face image group, respectively, and use the granular decomposition feature algorithm to extract the nose texture feature corresponding to the nose texture patch group, the bull eye feature corresponding to the bull eye patch group, and the ear texture feature corresponding to the ear texture patch group, respectively, and then splice the nose texture feature, the bull eye feature, and the ear texture feature into a bull face texture feature;

[0175] The cow face recognition module 105 is used to perform modal fusion of the cow face structural features and the cow face texture features to obtain standard cow face features, calculate the cow face number corresponding to the standard cow face features using a pre-trained cow face recognition model, and end the cow face recognition.

[0176] In detail, the modules described in the artificial intelligence-based cow face recognition device 100 in this embodiment of the invention employ the same methods as described above during use. Figures 1 to 3 The method uses the same technology as the AI-based cow face recognition method described above and can produce the same technical effect, so it will not be repeated here.

[0177] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0178] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0179] In addition, each functional module in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware, or in the form of hardware plus software function module.

[0180] It is obvious for those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and the present application can be realized in other specific forms without departing from the spirit or essential characteristics of the present application.

[0181] Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present application is defined by the appended claims rather than the above description, and all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present application. Any additional reference signs in the claims should not be considered as limiting the claims involved.

[0182] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. Wherein, artificial intelligence (AI) is to use digital computers or digital computer controlled machines to simulate, extend and expand human intelligence, perceive environment, acquire knowledge and use knowledge to obtain the best results.

[0183] In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. The plurality of units or devices stated in the system embodiments can also be realized by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.

[0184] Finally, it should be pointed out that the above embodiments are only used to illustrate the technical solutions of the present application and not to limit it, although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present application.

Claims

1. An artificial intelligence-based cattle face recognition method, characterized by, The method comprises: S1: acquiring a real-time cow face image group, sequentially performing weight texture denoising, picture enhancement and picture standardization operations on the real-time cow face image group to obtain a standard cow face image group, wherein the sequentially performing weight texture denoising, picture enhancement and picture standardization operations on the real-time cow face image group to obtain a standard cow face image group comprises: S11: selecting each real-time cow face picture in the real-time cow face image group as a target real-time cow face picture, and sliding the target real-time cow face picture pixel by pixel using a preset denoising window, and taking the picture block corresponding to the denoising window as a target cow face picture block; S12: calculating the texture weight of the target cow face picture block using the following texture weight algorithm: Wherein, W refers to the texture weight, m is the pixel length of the target cow face tile, n is the pixel width of the target cow face tile, i refers to the ith pixel in the target cow face tile in the horizontal direction, j refers to the jth pixel in the target cow face tile in the vertical direction, G is the gray symbol, and δ is a preset weight coefficient. (x+i,y+j) G(x+i,y+j) refers to the gray value of the pixel with the coordinate point (x+i, y+j) in the target cow face tile. (x,y) G(x,y) refers to the gray value of the pixel with the coordinate point (x, y) in the target cow face tile. S13: performing multi-level denoising filtering on each target cow face picture block in the target real-time cow face picture according to the texture weight to obtain a target denoised cow face picture; S14: sequentially performing gray scale enhancement and contrast enhancement operations on the target denoised cow face picture to obtain a target enhanced cow face picture; S15: performing picture stretching operation on the target denoised cow face picture according to a preset picture size to obtain a standard cow face picture, and collecting all the standard cow face pictures into a standard cow face image group; S2: performing edge fitting operation on the standard cow face image group using a structure recursive refinement algorithm to obtain a standard cow face contour group, and performing picture segmentation on the standard cow face image group using the standard cow face contour group to obtain an interest cow face image group; S3: sequentially extracting the spot feature, the skeleton feature and the horn feature corresponding to the interest cow face image group, and splicing the spot feature, the skeleton feature and the horn feature into a cow face structure feature; S4: extracting a noseprint picture block group, a cow eye picture block group and an earprint picture block group from the interest cow face image group respectively, extracting a noseprint feature corresponding to the noseprint picture block group, a cow eye feature corresponding to the cow eye picture block group and an earprint feature corresponding to the earprint picture block group using a granularity decomposition feature algorithm, and splicing the noseprint feature, the cow eye feature and the earprint feature into a cow face texture feature; S5: modality fusion of the cow face structure feature and the cow face texture feature to obtain a standard cow face feature, and calculating a cow face number corresponding to the standard cow face feature using a pre-trained cow face recognition model, and ending the cow face recognition. 2.The artificial intelligence-based cow face recognition method of claim 1, wherein The edge fitting operation on the standard cow face image group using the structure recursive refinement algorithm to obtain a standard cow face contour group comprises: selecting each picture in the standard cow face image group as a target standard cow face picture, performing edge detection on the target standard cow face picture to obtain a primary cow face edge group; performing line segment connection on the primary cow face edge group to obtain a primary cow face contour; performing edge fitting on the primary cow face contour to obtain a secondary cow face contour; performing edge refinement on the secondary cow face contour using the following structure recursive refinement algorithm to obtain a standard cow face contour, and collecting all the standard cow face contours into a standard cow face contour group: B(t) = (1 - t) 2 x P0+ 2 x (1 - t) x t x P1+ t 2 x P2 Wherein, B(t) refers to a point at t position on a segment of the profile curve in the secondary cow face profile, t is a position coefficient point of the profile curve, and the value range of t is [0, 1], P0 refers to the starting point of the profile curve, P1 refers to the midpoint of the profile curve, and P2 refers to the terminal point of the profile curve. 3.The artificial intelligence-based cow face recognition method of claim 1, wherein The picture segmentation of the standard cow face picture set by using the standard cow face profile set comprises the following steps: The standard cow face profile in the standard cow face profile set is selected as a target standard cow face profile one by one, and the standard cow face picture corresponding to the target standard cow face profile in the standard cow face picture set is taken as a target standard cow face picture; A target profile mask is generated according to the target standard cow face profile; The target profile mask is used for mask cropping operation on the target standard cow face picture to obtain an interest cow face picture, and all interest cow face pictures are collected into an interest cow face picture set. 4.The artificial intelligence-based cow face recognition method of claim 1, wherein The spot feature, the skeleton feature and the horn feature corresponding to the interest cow face picture set are extracted in sequence, which comprises the following steps: The interest cow face picture in the interest cow face picture set is selected as a target interest cow face picture one by one, and a gray scale detection algorithm is used to extract a cow face spot block corresponding to the target interest cow face picture; The spot proportion, the spot centroid and the spot distance of the cow face spot block are calculated respectively, and the spot proportion, the spot centroid and the spot distance are taken as target spot features; A cow face eye socket block, a cow face nose bridge block and a cow face horn block are extracted from the target interest cow face picture respectively; The horn angle, the horn profile and the horn distance corresponding to the cow face horn block are extracted respectively, and the horn angle, the horn profile and the horn distance are taken as target horn features. The mean vector of all target spot features is taken as a spot feature, the mean vector of all target skeleton features is taken as a skeleton feature, and the mean vector of all target horn features is taken as a horn feature. The cow face eye socket block, the cow face nose bridge block and the cow face horn block are extracted from the target interest cow face picture respectively, which comprises the following steps: The target interest cow face picture is sequentially subjected to multi-level convolution and multi-level pooling to obtain an interest cow face feature map; 5.The artificial intelligence-based cow face recognition method of claim 4, wherein The interest cow face feature map is sequentially subjected to convolution and full connection operation to obtain a bounding box set; The non-maximum suppression operation is performed on the bounding box set to obtain a standard bounding box set; The cow face eye socket bounding box, the cow face nose bridge bounding box and the cow face horn bounding box are extracted from the standard bounding box set according to the category probability corresponding to each standard bounding box in the standard bounding box set; The block corresponding to the cow face eye socket bounding box in the target interest cow face picture is taken as a cow face eye socket block; The block corresponding to the cow face nose bridge bounding box in the target interest cow face picture is taken as a cow face nose bridge block; ​ ​ The patch corresponding to the boundary box of the cow face and horn in the target cow face picture is taken as a cow face and horn patch. 6.The artificial intelligence-based cow face recognition method of claim 1, wherein The noseprint feature corresponding to the noseprint patch group, the cow eye feature corresponding to the cow eye patch group, and the earprint feature corresponding to the earprint patch group are extracted by using the granularity decomposition feature algorithm, and the granularity decomposition feature algorithm comprises the following steps: The noseprint patch group is sequentially subjected to uniform segmentation, feature extraction, weighted feature aggregation, random down-sampling, and feature mean value extraction to obtain the noseprint feature. The cow eye patch group is sequentially subjected to uniform segmentation, feature extraction, weighted feature aggregation, random down-sampling, and feature mean value extraction to obtain the cow eye feature. The earprint patch group is sequentially subjected to uniform segmentation, feature extraction, weighted feature aggregation, random down-sampling, and feature mean value extraction to obtain the earprint feature. 7.The artificial intelligence-based cow face recognition method of claim 6, wherein, The noseprint patch group is sequentially subjected to uniform segmentation, feature extraction, weighted feature aggregation, random down-sampling, and feature mean value extraction to obtain the noseprint feature, and the granularity decomposition feature algorithm comprises the following steps: The noseprint patches in the noseprint patch group are sequentially selected as target noseprint patches, and the target noseprint patches are subjected to uniform segmentation to obtain a target noseprint granularity patch group. The target noseprint granularity patch group is subjected to convolution operation to obtain a target noseprint granularity feature group. The target noseprint granularity feature group is subjected to weighted feature aggregation operation to obtain a target weighted noseprint feature group. The target weighted noseprint feature group is subjected to random down-sampling operation to obtain a target noseprint feature, and the mean value vector of all target noseprint features is taken as the noseprint feature. 8.The artificial intelligence-based cow face recognition method of claim 1, wherein, The cow face structure feature and the cow face texture feature are subjected to modal fusion to obtain a standard cow face feature, and the modal fusion comprises the following steps: The cow face structure feature is dimensionally sampled into a standard structure feature by using a preset global pooling layer. The cow face texture feature is dimensionally sampled into a standard texture feature by using the global pooling layer. The structure attention weight corresponding to the standard structure feature and the texture attention weight corresponding to the standard texture feature are calculated by using a self-attention mechanism. The standard texture feature and the standard structure feature are subjected to weighted feature fusion according to the structure attention weight and the texture attention weight to obtain a standard cow face feature. 9.The artificial intelligence-based cow face recognition method of claim 1, wherein The standard cow face feature is calculated by using a pre-trained cow face recognition model, and the cow face recognition is ended, and the cow face recognition model comprises the following steps: The standard cow face feature is subjected to down-sampling operation by using a pre-trained cow face recognition model to obtain a dimensionally reduced cow face feature. The dimensionally reduced cow face feature is subjected to normalization operation by using the cow face recognition model to obtain a cow face feature code. The cow face feature code is queried in a cow face number library of the cow face recognition model to obtain a cow face number corresponding to the cow face feature code.

10. An artificial intelligence-based cattle face recognition device, characterized by, The device comprises: The picture enhancement module is used to acquire a real-time cow face picture group, sequentially performs weight texture denoising, picture enhancement and picture normalization operation on the real-time cow face picture group, and obtains a standard cow face picture group. The standard cow face picture group is obtained by sequentially performing weight texture denoising, picture enhancement and picture normalization operation on the real-time cow face picture group, including: selecting each real-time cow face picture in the real-time cow face picture group as a target real-time cow face picture, and using a preset denoising window to slide pixel by pixel on the target real-time cow face picture, and taking a picture block corresponding to the denoising window as a target cow face picture block; and calculating the texture weight of the target cow face picture block by using the following texture weight algorithm: wherein, W refers to the texture weight, m is the pixel length of the target cow face patch, n is the pixel width of the target cow face patch, i refers to the ith pixel in the target cow face patch in the horizontal direction, j refers to the jth pixel in the target cow face patch in the vertical direction, G is a gray symbol, δ is a preset weight coefficient, G (x+i,y+j) refers to the gray value of the pixel with the coordinate point (x+i, y+j) in the target cow face patch, G (x,y) refers to the gray value of the pixel with the coordinate point (x, y) in the target cow face patch; performing multi-level denoising filtering on each target cow face patch in the target real-time cow face picture according to the texture weight to obtain a target denoised cow face picture; sequentially performing gray enhancement and contrast enhancement operations on the target denoised cow face picture to obtain a target enhanced cow face picture; performing picture stretching on the target denoised cow face picture according to a preset picture size to obtain a standard cow face picture, and collecting all the standard cow face pictures into a standard cow face group; The picture segmentation module is used to perform edge fitting operation on the standard cow face picture group by using a structure recursive refinement algorithm, obtain a standard cow face contour group, and perform picture segmentation on the standard cow face picture group by using the standard cow face contour group, to obtain an interesting cow face picture group. The structure extraction module is used to sequentially extract spot features, skeletal features and horn features corresponding to the interesting cow face picture group, and splice the spot features, skeletal features and horn features into cow face structure features. The texture extraction module is used to extract a nose texture picture block group, a cow eye picture block group and an ear texture picture block group from the interesting cow face picture group respectively, extract nose texture features corresponding to the nose texture picture block group, cow eye features corresponding to the cow eye picture block group and ear texture features corresponding to the ear texture picture block group by using a granularity decomposition feature algorithm respectively, and splice the nose texture features, the cow eye features and the ear texture features into cow face texture features. The cow face recognition module is used to perform modal fusion on the cow face structure features and the cow face texture features, to obtain standard cow face features, calculate a cow face number corresponding to the standard cow face features by using a pre-trained cow face recognition model, and end the cow face recognition.

Citation Information

Patent Citations

  • CNN, SVM and ResNet combined cattle face recognition method

    CN113553968A

  • Sheep face recognition system and method

    CN113780207A