Pet identification method, device and equipment and storage medium

By continuously acquiring multiple frames of pet facial images, identifying and fusing key features by region, and combining them with a deep learning model, the problem of accuracy and stability in pet identification under complex scenarios in existing technologies has been solved, achieving high-precision pet identification.

CN120954058BActive Publication Date: 2026-02-10SHENZHEN KUAITONG TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511487346.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2026-02-10
Estimated Expiration
2045-10-17

AI Technical Summary

Technical Problem

Existing pet identification technologies suffer from low accuracy, poor robustness, and insufficient feature extraction when faced with complex scenarios such as poor image quality, incomplete feature information, changes in ambient lighting, and diverse pet postures.

Method used

By continuously acquiring multiple frames of pet facial images, five key feature regions were identified in different areas, and feature sets for the eyes, nose, mouth, ears, and contours were constructed. An integrity scoring mechanism was introduced to quantitatively analyze image clarity, occlusion degree, and structural integrity. Feature fusion was used to generate facial feature maps, and a deep learning embedding model was used to perform similarity matching with database images.

Benefits of technology

It significantly improves the accuracy and stability of pet facial recognition, enhances recognition accuracy and robustness in complex environments, generates high-quality facial feature maps, and improves the matching accuracy with database images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120954058B_ABST
    Figure CN120954058B_ABST
Patent Text Reader

Abstract

Embodiments of the present application apply to the technical field of image recognition, and specifically provide a pet identity recognition method, device, equipment and storage medium, comprising: continuously collecting multiple frames of face images of a pet, performing face feature recognition on the face images, obtaining an image feature set, performing integrity evaluation on a subset of the image feature set, and obtaining an integrity score of each subset; if the integrity scores of all subsets in a certain feature set are all lower than a preset threshold, performing feature fusion on the corresponding subset until a subset with an integrity score higher than the preset threshold appears; after extracting the subset with the highest integrity score, performing image fusion to generate a face feature map, and performing similarity matching to identify the corresponding pet identity. The technical solution of the embodiments of the present application can realize high-precision pet identity recognition, and improve the problem of insufficient recognition accuracy and stability in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image recognition, and in particular to a pet identity recognition method and device, equipment and a storage medium. BACKGROUND

[0002] With the rapid development of the pet economy and the rapid growth of the number of pets, pet identity recognition technology has become an important technical requirement in the fields of pet management, medical care, and lost and found. Traditional pet identity recognition mainly relies on physical marking methods such as implanted chips and collar identification, but these methods have limitations such as being easy to lose, easy to damage, and requiring special equipment for reading. In recent years, pet identity recognition technology based on biological features has gradually emerged, among which face recognition technology has attracted attention due to its non-contact, convenience and accuracy, and has become one of the core technologies of intelligent pet management systems.

[0003] In existing solutions, pet identity recognition is performed through single-frame image face feature extraction and template matching. Specifically, a single pet face image is collected by a camera device, the overall face feature vector is extracted using traditional image processing algorithms, and then a similarity comparison is performed with a pre-stored pet face template. The pet identity is determined according to the matching result, and automatic pet recognition is achieved, providing technical support for pet management.

[0004] For the above technical solution, although single-frame image feature extraction can achieve basic pet identity recognition function, in the face of complex actual application scenarios such as poor image quality, incomplete feature information, environmental light changes, and pet posture diversity, there are problems of low recognition accuracy, poor robustness, and insufficient feature extraction. SUMMARY

[0005] Embodiments of the present application provide a pet identity recognition method, device, equipment and storage medium, which can improve the above-mentioned problems of insufficient recognition accuracy and stability.

[0006] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.

[0007] According to an aspect of the embodiments of the present application, a pet identity recognition method is provided, which comprises: continuously collecting multiple frames of face images of a pet, performing face feature recognition on the face images to obtain an image feature set; performing integrity evaluation on subsets in the image feature set to obtain integrity scores of the subsets; if the integrity scores of all subsets in a certain feature set in the image feature set are all lower than a preset threshold, performing feature fusion on the corresponding subsets until a subset with an integrity score higher than the preset threshold appears; extracting the subset with the highest integrity score in the image feature set, and performing image fusion on the subset with the highest score to generate a face feature map; performing similarity matching on the face feature map and a preset picture in a database to obtain a similarity score, and recognizing the corresponding pet identity based on the similarity score.

[0008] In some embodiments of the present application, based on the foregoing scheme, the step of continuously collecting multiple frames of face images of a pet, and performing face feature recognition on the face images to obtain an image feature set comprises: continuously collecting multiple frames of face images of a pet through a camera, performing face region positioning and cutting on all the face images to obtain multiple cut face images; identifying the pupil position, eye shape and eye texture features of all the cut face images through a detection algorithm to construct an eye feature set; extracting the nose bridge curve, nostril shape and nose color distribution features of all the cut face images through a contour detection algorithm to construct a nose feature set; extracting the lip contour, mouth opening and closing state and hair distribution features around the mouth of all the cut face images through an edge detection algorithm to construct a mouth feature set; extracting the ear contour, ear erecting state and ear hair texture features of all the cut face images through a shape recognition algorithm to construct an ear feature set; and extracting the overall shape of the head, the face width-height ratio and the hair distribution of all the cut face images through a boundary detection algorithm to construct a contour feature set.

[0009] In some embodiments of the present application, based on the foregoing scheme, the step of performing integrity evaluation on subsets in the image feature set to obtain integrity scores of the subsets comprises: calculating the zero value proportion of each subset in the image feature set to evaluate the missing degree of the features, to obtain a missing degree score of each subset; analyzing the variance and signal-to-noise ratio of each subset in the image feature set to evaluate the clarity degree of the features, to obtain a clarity degree score of each subset; calculating the correlation and stability between each subset in the image feature set to evaluate the consistency degree of the features, to obtain a consistency score of each subset; and performing weighted average calculation on the missing degree score, the clarity degree score and the consistency score of each subset to obtain the integrity score of each subset.

[0010] In some embodiments of the present application, based on the foregoing scheme, if the integrity score of all subsets of a certain feature set in the image feature set is lower than the preset threshold, the corresponding subset is fused until a subset with an integrity score higher than the preset threshold is obtained, including: when it is detected that the integrity score of all subsets of a certain feature set in the image feature set is lower than the preset threshold, the same set data in the subset lower than the preset threshold is used for feature fusion and splicing to obtain a combined subset; the combined subset is subjected to integrity evaluation and its integrity score is calculated, and if the integrity score of the combined subset is still lower than the preset threshold, the fusion and splicing processing flow is continuously executed until a subset with an integrity score higher than the preset threshold is generated.

[0011] In some embodiments of the present application, based on the foregoing scheme, the step of extracting the subset with the highest integrity score from the image feature set and performing image fusion on the subset with the highest score to generate a face feature map, including: arranging all subsets in the image feature set in descending order according to the integrity score by using a scoring sorting algorithm; selecting the eye feature subset, the nose feature subset, the mouth feature subset, the ear feature subset and the contour feature subset with the highest integrity score from the eye feature set, the nose feature set, the mouth feature set, the ear feature set and the contour feature set, respectively; inputting the eye feature subset, the nose feature subset, the mouth feature subset, the ear feature subset and the contour feature subset into a feature image reconstruction module to obtain a face feature map.

[0012] In some embodiments of the present application, based on the foregoing scheme, the step of inputting the eye feature subset, the nose feature subset, the mouth feature subset, the ear feature subset and the contour feature subset into a feature image reconstruction module to obtain a face feature map includes: in the feature image reconstruction module, reconstructing the eye feature subset into an eye feature image block of 64x64 pixels, reconstructing the nose feature subset into a nose feature image block of 48x48 pixels, reconstructing the mouth feature subset into a mouth feature image block of 32x32 pixels, reconstructing the ear feature subset into an ear feature image block of 40x40 pixels, and reconstructing the contour feature subset into a contour feature image block of 80x80 pixels by using a deconvolutional neural network; positioning the eye feature image block, the nose feature image block, the mouth feature image block, the ear feature image block and the contour feature image block to corresponding positions of a preset standard face feature map template of 256x256 pixels; performing multi-layer decomposition on the eye feature image block, the nose feature image block, the mouth feature image block, the ear feature image block and the contour feature image block at the corresponding positions by using a Laplacian pyramid decomposition technique, and performing feature fusion at each decomposition level by using a weighted average and edge preserving filter algorithm to obtain fused multi-layer features; and recombining the fused multi-layer features by using a Laplacian pyramid reconstruction technique to obtain a face feature map.

[0013] In some embodiments of the present application, based on the foregoing scheme, the step of performing similarity matching between the face feature map and a preset picture in a database to obtain a similarity score, and identifying a corresponding pet identity based on the similarity score includes: performing feature extraction on the face feature map by using a preset deep convolutional neural network to obtain a global feature description set; calling all standard face feature maps of registered pets from a preset pet identity database, performing feature coding on each standard face feature map in the database by using the deep convolutional neural network to obtain a corresponding standard feature description set; calculating the similarity between the global feature description set and all the standard feature description sets one by one by using a weighted combination of a cosine similarity calculation formula and an Euclidean distance calculation formula to obtain a similarity score; when the similarity score is greater than a preset identity recognition threshold, outputting the corresponding pet identity as a recognition result; and when the similarity score is lower than the identity recognition threshold, outputting an unidentified state and prompting to re-collect a face image.

[0014] According to another aspect of the embodiments of this application, a pet identification method and apparatus are provided, comprising: an acquisition module for continuously acquiring multiple frames of facial images of a pet, performing facial feature recognition on the facial images to obtain an image feature set; an evaluation module for evaluating the integrity of subsets in the image feature set to obtain an integrity score for each subset; a fusion module for performing feature fusion on the corresponding subset if the integrity scores of all subsets in a certain feature set of the image feature set are lower than a preset threshold, until a subset with an integrity score higher than the preset threshold appears; a generation module for extracting the subset with the highest integrity score in the image feature set, and performing image fusion on the subset with the highest score to generate a facial feature map; and an identification module for performing similarity matching between the facial feature map and images preset in a database to obtain a similarity score, and identifying the corresponding pet identity based on the similarity score.

[0015] According to another aspect of the embodiments of this application, an electronic device is provided, including a memory and a processor, the memory storing a computer program executable on the processor, the processor executing the computer program to implement the pet identification method described in any one of the above.

[0016] According to another aspect of the present application, a computer-readable storage medium is provided having a computer program stored thereon, which, when run by a processor, causes the processor to perform any of the above-described pet identification methods.

[0017] Compared with existing technologies, this application has the following advantages: high recognition accuracy and strong stability. By continuously acquiring multiple frames of pet facial images and identifying five key feature regions, corresponding eye feature sets, nose feature sets, mouth feature sets, ear feature sets, and contour feature sets are constructed. This makes pet facial recognition no longer dependent on single-frame images, significantly improving the quantity and diversity of original feature data. By introducing an integrity scoring mechanism, quantitative analysis is performed on image clarity, occlusion degree, and structural integrity to ensure that the images used subsequently have high recognition value. At the same time, to solve the problem of information loss caused by low-quality images, the highest-scoring subsets of each feature set are extracted and structured image fusion is performed to generate a facial feature map in a unified format. Then, a deep learning embedding model is used to perform similarity matching with database images to achieve high-precision pet identification, improving the problems of insufficient recognition accuracy and stability in existing technologies. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating the pet identification method provided in an embodiment of the present invention;

[0019] Figure 2This is a schematic block diagram of the structure of the pet identification device provided in the embodiment of the present invention;

[0020] Figure 3 This is a schematic block diagram of the structure of the electronic device provided in the embodiment of the present invention. Detailed Implementation

[0021] Exemplary embodiments will now be described in a more comprehensive manner with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in various forms and should not be construed as limited to these examples; rather, these embodiments are provided so that this application will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art.

[0022] Furthermore, the features, structures, or characteristics described in this application can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to provide a full understanding of the embodiments of this application. However, those skilled in the art will recognize that when implementing the technical solutions of this application, not all the detailed features in the embodiments may be used, one or more specific details may be omitted, or other methods, elements, devices, steps, etc., may be employed.

[0023] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0024] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0025] It should be noted that "multiple" in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0026] The technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0027] Example 1:

[0028] like Figure 1As shown, this application provides a pet identification method, which can be used to achieve automatic identification and accurate matching of pet identities. It is applicable to scenarios such as pet management systems, pet hospital reception systems, and pet lost and found platforms. The identification method mainly includes the following steps:

[0029] Step S10: Continuously acquire multiple frames of facial images of the pet, perform facial feature recognition on the facial images, and obtain an image feature set.

[0030] In this step, high-definition cameras deployed in the pet activity area continuously capture facial images of the pets. The frame rate is set to 25 frames per second, and the acquisition duration is no less than 3 seconds to ensure that at least 75 valid images are obtained. During image acquisition, data is encoded in YUV image format and cached in memory in real time. Each received facial image frame is input into the facial feature recognition module. This module is based on a multi-task facial segmentation network built on existing convolutional neural networks (such as MobileNetV2 or ResNet18), which identifies five key regions in the image and outputs local images of the eyes, nose, mouth, ears, and contours, respectively. These images are stored in the order of extraction time into the eye feature set, nose feature set, mouth feature set, ear feature set, and contour feature set, respectively. Each feature set includes multiple image subsets.

[0031] In this example step, a ResNet18-based local region recognition network is used to divide the facial image into 5 regions, with each region having a uniform output size of 128×128 pixels, and the image data is stored in RGB format. Taking 10 eye region images identified from consecutive frames as an example, these images form 10 subsets of the eye feature set, which are used for subsequent image quality scoring and fusion.

[0032] Step S20: Perform integrity assessment on subsets of the image feature set to obtain integrity scores for each subset.

[0033] In this step, an integrity score is evaluated sequentially for each subset of images within each feature set. The integrity score includes three dimensions: image sharpness, feature occlusion, and structural integrity. Image sharpness is evaluated using the Laplacian variance index; feature occlusion is analyzed using region grayscale histograms to determine the presence of occlusions or shadows; structural integrity is assessed based on a pre-trained structural alignment model to determine if the number of image feature points meets expectations (e.g., at least 5 key points need to be extracted from the eye subset). The score is represented by a real number between 0 and 1, with values ​​closer to 1 indicating higher integrity. The final integrity score for each subset is a weighted sum of the three metrics, with weighting coefficients set as follows: sharpness 0.4, occlusion 0.3, and structural integrity 0.3.

[0034] In this example step, the third frame image in the eye feature set is scored. Its Laplacian variance is 205 (higher than the set threshold of 150), the occlusion ratio is less than 10%, and 6 valid key points are detected. Therefore, the final integrity score is 0.86, and it is retained as a candidate image.

[0035] Step S30: If the integrity scores of all subsets in a certain feature set of the image feature set are lower than the preset threshold, then feature fusion is performed on the corresponding subsets until a subset with an integrity score higher than the preset threshold appears.

[0036] In this step, a threshold of 0.75 is set for the integrity score. If the scores of all subsets within a certain feature set are lower than this value, the feature fusion mechanism is activated. The feature fusion module performs alignment, weighted fusion, and enhancement processing on the feature images. Image alignment uses affine transformations from the Dlib library to align keypoints in all subset images; weighted fusion employs an image pyramid fusion strategy, giving higher weights to high-resolution images (e.g., weighted by integrity score values); and the enhancement stage applies Gamma correction to improve contrast. The new image generated after fusion is considered a new subset and re-enters the integrity scoring process. If its score is higher than the threshold, it replaces the original subset for subsequent processing.

[0037] In this example step, a certain nasal feature set contains 5 subsets, all of which have scores below 0.65. The system performs a fusion process on them, and the fused image has a score of 0.78, which meets the threshold standard and is adopted as a new subset.

[0038] Step S40: Extract the subset with the highest integrity score from the image feature set, and fuse the subset with the highest score to generate a facial feature map.

[0039] In this step, the subset with the highest integrity score in each feature set is selected as the representative image. These five images are then input into the image fusion module for synthesis. Image fusion employs a regional stitching and morphological coordination strategy: first, the five feature images are relatively positioned and stitched according to the facial region template to ensure consistent structural proportions; then, multi-channel image filtering is used to smooth the transitions at the boundaries, preventing breaks or unnatural transitions in the fused image. The final output facial feature map is fixed at 256×256 pixels and undergoes uniform histogram equalization to enhance image contrast.

[0040] In this example step, the scores of the five extracted subsets are 0.86 for the eyes, 0.78 for the nose, 0.81 for the mouth, 0.83 for the ears, and 0.80 for the contour. Finally, a facial feature map containing the complete facial structure is synthesized, with a clear image and rich feature points.

[0041] Step S50: Match the facial feature map with images preset in the database to obtain a similarity score, and identify the corresponding pet based on the similarity score.

[0042] In this step, the generated facial feature map is input into a similarity matching engine and compared one-to-many with standard facial images stored in the database. The matching method is based on a deep learning image embedding model (such as FaceNet), extracting the embedding vector of the facial feature map and calculating the cosine similarity with the embedding vector of each image in the database. If the similarity score is higher than the recognition threshold (e.g., 0.88), the match is successful, and the corresponding pet identification number is returned. Each standard image in the database has undergone uniform image preprocessing and feature vector generation to ensure consistency and accuracy of the comparison.

[0043] In this example step, the extracted facial feature map has a similarity score of 0.91 with the database image numbered PET-108, which exceeds the recognition threshold of 0.88. Therefore, it is identified as an individual with the pet identification number PET-108.

[0044] In this embodiment, multiple frames of a pet's facial images are continuously acquired, and facial feature recognition is performed on these images to extract image feature sets. Then, the integrity of each subset within the five feature sets is evaluated to obtain an integrity score for each subset. If the integrity scores of all subsets within a particular feature set (eye, nose, mouth, ear, or contour) are all below a preset threshold, feature fusion is performed on multiple subsets within that feature set until at least one subset has an integrity score above the preset threshold. Next, the subsets with the highest integrity scores are extracted from each of the five feature sets, and these highest-scoring subsets are fused to generate a facial feature map. Finally, the facial feature map is compared with images preset in a database for similarity matching, and the pet's identity is identified based on the similarity score.

[0045] By acquiring multiple frames of facial images of pets and using the eye, nose, mouth, ear, and contour feature sets extracted from consecutive images as the basis for recognition, the comprehensiveness and stability of facial feature information are effectively improved. By introducing an integrity scoring mechanism, the quality of local features in each frame can be quantified, avoiding recognition errors caused by image blurring, occlusion, or angle changes. Simultaneously, a feature fusion strategy is employed for feature subsets with scores below a preset threshold, enhancing the integrity and robustness of the facial feature map. Finally, the best-scoring feature subsets are selected for image fusion, effectively generating high-quality facial feature maps and improving the accuracy of matching with images in the database. Compared to existing single-frame image recognition methods, this method significantly enhances recognition accuracy and stability in complex environments, demonstrating good practicality and adaptability.

[0046] Specifically, step S10 can preferably be implemented in the following embodiment:

[0047] Several facial images of the pet are captured continuously in multiple frames by a camera. The facial regions of all the facial images are located and cropped to obtain several cropped facial images.

[0048] In this example, the camera acquisition module uses a high-definition camera with a resolution of 5 megapixels or higher to capture images at a frame rate of 25fps, acquiring approximately 75 frames over a 3-second duration. The acquired images are then input into the Haar Cascade Classifier in OpenCV for facial region localization, identifying the rectangular bounding box of the pet's face. After localization, the facial region image is cropped from the original image using Region of Interest (ROI) extraction, uniformly cropped to a size of 256×256 pixels, and scaled using bilinear interpolation to ensure a consistent image input size for subsequent feature recognition.

[0049] For example, for a cat facing the camera, its face is identified in the image as a bounding box (80, 120, 300, 300), cropped to obtain a 256×256 pixel facial image, and saved in the image queue for subsequent processing. If 75 frames are captured consecutively, 75 cropped facial images are generated.

[0050] The detection algorithm identifies the pupil position, eye shape, and eye texture features of all cropped facial images to construct an eye feature set.

[0051] In this example, a 68-point facial keypoint detector (based on a regression tree-based face tagging regression algorithm) from the pre-trained deep learning model Dlib is used to detect the pupil position and eye contour shape in each cropped image. Eye texture feature extraction uses the Local Binary Pattern (LBP) method to encode the detected eye regions in the images. The identified eye regions in each image are extracted into 64×64 sub-images, and metadata containing pupil coordinates, eye contour geometric parameters, and LBP texture encoding information are packaged together to form an eye subset.

[0052] For example, in the 10th frame image, the pupil position detected by the left eye is (85,102) and that of the right eye is (170,100). The eye contour includes the coordinates of 6 boundary points. The LBP histogram is encoded as a 128-dimensional vector, which constitutes the eye subset of this frame and is added to the eye feature set.

[0053] A nose feature set is constructed by extracting the nose bridge curve, nostril shape, and nose color distribution features from all cropped facial images using a contour detection algorithm.

[0054] In this example, the Canny edge detection algorithm combined with polygon fitting methods (such as the Ramer–Douglas–Peucker algorithm) is used to identify the nasal bridge edge curve, and morphological dilation operations in OpenCV are used to highlight edge coherence. For the nostril region, color clustering methods (such as K-means clustering, K=3) are used to cluster color features within the nasal region, extracting the nostril boundaries and color distribution centers. The extracted nasal images are uniformly 64×64 pixels in size, and the metadata includes the coordinates of curve control points, nostril boundary ellipse parameters, and RGB average color values.

[0055] For example, in the 20th frame image, the Canny algorithm detects the nose bridge edge and obtains a nose bridge curve composed of (128,110)-(128,160). K-means clustering identifies that the dark gray color is the main color in the nasal region, and the center pixel value is (85,85,85). This frame image constitutes a subset of the nose and is added to the nasal feature set.

[0056] The lip contour, mouth opening and closing status, and hair distribution features around the mouth of all cropped facial images are extracted using an edge detection algorithm to construct a mouth feature set.

[0057] In this example, the lip contour uses the Sobel edge detection algorithm (a combination of SobelX and SobelY directions) to extract the lip edge gradient, forming a closed boundary. The mouth's open / closed state is determined by calculating the distance between the upper and lower lips (the vertical distance between key points on both lips); if the distance exceeds a set threshold (e.g., 10 pixels), it is considered an open mouth. The distribution of hair around the mouth is analyzed using a Gabor filter to extract texture direction and frequency features, used to determine the boundary between the mouth contour and the hairline. The mouth feature image is 64×64 pixels.

[0058] For example, in the 35th frame image, Sobel edge detection identified the closed boundary of the mouth, with a distance of 8 pixels between the upper and lower lips, indicating a closed mouth state. Gabor filtering analysis showed that the direction angle of the hair texture around the mouth was concentrated at 45°, forming a subset of the mouth, which was added to the mouth feature set.

[0059] The ear contour, ear erection status, and ear hair texture features of all cropped facial images are extracted using a shape recognition algorithm to construct an ear feature set.

[0060] In this example, ear contour extraction uses Hu rectangular invariant moments (HuMoments) combined with a contour finding algorithm (such as the findContours function in OpenCV) to perform shape matching and recognition of the ear. Ear erection is determined by calculating the angle between the line connecting the ear tip and ear root and the horizontal axis; an angle greater than 45° indicates an erect ear, while a smaller angle indicates a drooping ear. Ear hair texture feature extraction uses the Gray-Level Co-occurrence Matrix (GLCM) method to analyze the spatial correlation between image gray levels. The image size remains 64×64 pixels and includes contour, state, and texture feature information.

[0061] For example, in the 50th frame image, the ear outline is identified as an approximately isosceles triangle, the first three terms of the Hu moment are [0.0025, 0.0008, 0.00005], the angle between the ear tip and the ear root line segment is 58°, the ear is determined to be in an erect state, the GLCM texture has strong directionality, forming a subset of the ear, and is added to the ear feature set.

[0062] The overall head shape, facial aspect ratio, and hair distribution of all cropped facial images are extracted using a boundary detection algorithm to construct a contour feature set.

[0063] In this example, the GrabCut image segmentation algorithm is used to extract the complete head contour. The foreground region is first manually initialized, and then the segmentation boundaries are automatically iteratively optimized. The width and height of the extracted head region are calculated to obtain the facial aspect ratio. Hair distribution is extracted using the Histogram of Oriented Gradients (HOG) to obtain a statistical distribution map of hair texture directions. These images are also scaled down to 64×64 pixels for storage.

[0064] For example, in the 60th frame image, the GrabCut algorithm identified the head contour boundary as a closed curve with a width of 180 pixels and a height of 200 pixels. The face aspect ratio was 0.9. The HOG feature showed that the hair direction was concentrated in the range of 30° to 60°, forming a contour subset, which was added to the contour feature set.

[0065] Specifically, step S20 can preferably be implemented in the following embodiment:

[0066] The degree of feature loss is assessed by calculating the proportion of zero values ​​in each subset of the image feature set, and a loss score is obtained for each subset.

[0067] The zero-value ratio refers to the ratio between the number of dimensions with zero values ​​in all feature dimensions within each subset and the total number of feature dimensions. Here, "zero value" indicates that the feature dimension was not effectively extracted, or that the detection result contains invalid or empty data. The missing value score is calculated by counting the number of dimensions with zero values ​​in the extracted feature vectors of each image subset and comparing this ratio to the total number of dimensions. A higher score indicates poorer effective feature extraction in that subset, suggesting a more severe missing value problem.

[0068] For example, if the feature vector extracted from a certain image in the eye feature subset is [0,0,0.34,0.52,0.11,0,0.03,0.67,0,0.88], then the subset has 4 zero values, a total dimension of 10, and a zero value ratio of 40%, which means the missing value score is 0.4.

[0069] The sharpness of the features is evaluated by analyzing the variance and signal-to-noise ratio of each subset in the image feature set, and a sharpness score for each subset is obtained.

[0070] In this example, the sharpness score of the subset is composed of two quantitative metrics: the variance of the image gradient distribution and the signal-to-noise ratio (SNR) between the feature signal and noise. The image gradient variance reflects the intensity of changes in image detail; the higher the variance, the more obvious the image edge information, and the higher the sharpness. In the calculation of the SNR, the signal is estimated from the high-frequency feature components of the image, while the noise is estimated from the low-amplitude changes in the edge regions. The sharpness score can be obtained by averaging the two metrics after normalization.

[0071] For example, after processing an ear image using the Sobel operator, its horizontal and vertical gradients are obtained, and its variance is calculated to be 0.015. At the same time, its signal mean is evaluated as 0.3 and its noise mean is 0.05. Then, SNR=20log(0.3 / 0.05)=15.56dB, and after normalization, the sharpness score is 0.87.

[0072] The consistency of features is evaluated by calculating the correlation and stability between each subset of the image feature set, and a consistency score is obtained for each subset.

[0073] In this example, the consistency score is evaluated using the Pearson correlation coefficient between different subsets within the same feature set (i.e., feature subsets derived from different frame images), measuring the stable repetition of features. Stability is quantified by the fluctuation of the standard deviation of the feature extraction results across time-series frames. If the feature distribution extracted from a feature set tends to be consistent across multiple frames and the fluctuation is small, its consistency score is high.

[0074] For example, in the mouth feature set, 10 subsets are extracted from 10 frames of images. The average value of the Pearson correlation coefficient between any two pairs is 0.91. Meanwhile, the average standard deviation of each dimension feature is 0.05 (relatively small). Then the consistency score can be set as 0.91×(1-0.05)=0.8645.

[0075] The completeness score of each subset is calculated by weighted averaging of the missingness score, clarity score, and consistency score.

[0076] In this example, the weighted average of the completeness score is calculated as follows: Completeness score = w1 × (1 - Missing score) + w2 × Clarity score + w3 × Consistency score, where w1, w2, and w3 are the weights of each indicator, satisfying w1 + w2 + w3 = 1. The weights can be pre-set according to the specific scenario, for example, w1 = 0.4, w2 = 0.3, w3 = 0.3, prioritizing the impact of missing scores.

[0077] For example, if a subset of ear features has a missing feature score of 0.2, a sharpness score of 0.8, and a consistency score of 0.9, then the completeness score = 0.4 × (1 - 0.2) + 0.3 × 0.8 + 0.3 × 0.9 = 0.32 + 0.24 + 0.27 = 0.83, indicating that the subset of ear features has high quality in feature extraction and is suitable for subsequent fusion processing.

[0078] Specifically, step S30 can preferably be implemented in the following embodiment:

[0079] When it is detected that the integrity scores of all subsets of a certain feature set in the image feature set are all lower than a preset threshold, feature fusion and splicing are performed using the same set data of the subsets that are lower than the preset threshold to obtain the combined subset.

[0080] In this example, the integrity score can be based on the weighted average of the missing value score, sharpness score, and consistency score defined in step S20. When the score is lower than a set threshold (e.g., 0.65), it indicates that the subset cannot independently support the recognition process and needs to be fused. The feature fusion and stitching process includes the following steps: First, the original image feature vectors of all subsets with scores below the threshold are standardized (e.g., Z-score standardization). Then, multiple subsets with higher scores are selected from the same feature set and formed into new enhanced subsets through feature-level concatenation. This process uses feature dimension alignment algorithms, such as PCA (Principal Component Analysis) or CCA (Canonical Correlation Analysis), to ensure that the stitched features have consistent vector dimensions and statistical properties, and uses the average value to fill in missing feature bits, ensuring that the integrity structure of the stitched feature is not destroyed.

[0081] For example, when all subsets of the ear feature set have integrity scores below 0.65, the system selects the three ear image subsets with the highest scores. Each subset has a 256-dimensional feature vector, which is then standardized using Z-scores and concatenated to initially form a 768-dimensional combined vector. Subsequently, PCA is used to reduce the dimensionality back to the original 256 dimensions, and the integrity score is recalculated for the new subset. If the score increases to 0.72, the integrity requirement is considered met, and the process proceeds to the next step. Otherwise, the system automatically increases the number of fused subsets (e.g., from 3 to 4 or 5) and repeats the concatenation and dimensionality reduction process until the score exceeds a preset threshold.

[0082] The integrity of the combined subset is evaluated and its integrity score is calculated. If the integrity score of the combined subset is still lower than the preset threshold, the fusion and splicing process continues until a subset with an integrity score higher than the preset threshold is generated.

[0083] In this example, the calculation process for the integrity score of the combined subset remains consistent with the original scoring process, i.e., it is still based on a weighted summation of three indicators: missing value score, sharpness score, and consistency score. After the combined subset is generated, it is first necessary to verify whether its missing value ratio in the target feature dimension has decreased (e.g., from the initial 0.40 to 0.25). If it does not meet the target integrity score set by the system (e.g., still below 0.65), it automatically proceeds to the next round of fusion. In each round of fusion, the system also needs to introduce a new discrimination mechanism, such as structural similarity (SSIM) detection, to exclude images with excessive redundancy with existing subsets, preventing the repeated superposition of feature information without generating actual information gain.

[0084] For example, when the system fused five subsets of nasal feature sets with scores below 0.65, the resulting combined subset had an integrity score of 0.62, which did not meet the threshold of 0.65. In the next round, the system increased the number of fused images to seven and used cosine similarity detection to remove images with redundancy exceeding 95%. The final combined subset's integrity score improved to 0.71, successfully passing the threshold test, and the system confirmed that this subset could be used for subsequent image fusion steps.

[0085] Specifically, step S40 can preferably be implemented in the following embodiment:

[0086] The image feature set is sorted in descending order according to its integrity score using a scoring and ranking algorithm.

[0087] In this example, the integrity score sorting algorithm is implemented using QuickSort, which has a time complexity of O(nlogn), enabling efficient sorting of integrity scores for a large number of subsets. The sorting result ensures that the subset with the highest integrity score is placed at the top, facilitating subsequent selection. During the sorting process, the system stores the integrity scores of all subsets in an array and achieves descending order through recursive partitioning and comparison, ensuring sorting stability and efficiency.

[0088] For example, there are 100 subsets in the eye feature set, each subset corresponding to an integrity score. The system inputs these scores into a quick sorting algorithm, and after sorting, the top five scores are 0.92, 0.89, 0.87, 0.85, and 0.83, respectively. The system selects the subset with the highest score of 0.92 as the representative of the feature set for subsequent processing.

[0089] Select the subset of eye features with the highest integrity score from the eye feature set; select the subset of nose features with the highest integrity score from the nose feature set; select the subset of mouth features with the highest integrity score from the mouth feature set; select the subset of ear features with the highest integrity score from the ear feature set; select the subset of contour features with the highest integrity score from the contour feature set; input the subsets of eye features, nose features, mouth features, ear features, and contour features into the feature image reconstruction module to obtain the facial feature map.

[0090] In this example, selecting the highest-scoring subset involves traversing the first item of the sorted list to directly locate the corresponding feature vector and associated original image data. After being input into the feature image reconstruction module, the system uses a pre-trained deconvolutional neural network model to reconstruct the image based on the dimension of each feature subset and the preset image size requirements. This deconvolutional neural network model employs an encoder-decoder structure, enabling it to reconstruct image patches corresponding to the input feature vectors, ensuring the visualization and spatial accuracy of feature information.

[0091] For example, the system selects subsets with integrity scores of 0.92 (eyes), 0.90 (nose), 0.88 (mouth), 0.85 (ears), and 0.87 (contours) from five feature sets, respectively, and inputs them into the corresponding deconvolutional network model to successfully reconstruct image patches of the corresponding size and resolution for subsequent fusion.

[0092] The step of inputting subsets of eye features, nose features, mouth features, ear features, and contour features into the feature image reconstruction module to obtain a facial feature map specifically includes:

[0093] In the feature image reconstruction module, the deconvolutional neural network reconstructs the eye feature subset into a 64×64 pixel eye feature image block, the nose feature subset into a 48×48 pixel nose feature image block, the mouth feature subset into a 32×32 pixel mouth feature image block, the ear feature subset into a 40×40 pixel ear feature image block, and the contour feature subset into an 80×80 pixel contour feature image block.

[0094] In this example, the deconvolutional neural network employs a deep learning model based on the U-Net architecture, specifically including an encoding layer to extract high-dimensional features and a decoding layer to progressively restore image resolution. The network input is a vector corresponding to a subset of features, which passes through several deconvolution (transposed convolution) layers, and the output is a grayscale or color image patch of the corresponding size. The network is trained on a large number of pet facial images to ensure accurate restoration of features for each part, and the output image patch has smooth edges and clear details.

[0095] For example, after inputting a subset of nasal features into a deconvolutional network, it outputs a 48×48 pixel image block, displaying a clear nasal bridge curve and nostril contour details; while for a subset of mouth features, it outputs a 32×32 pixel image block, accurately showing the lip contour and opening / closing state.

[0096] The spatial localization algorithm locates the eye feature image blocks, nose feature image blocks, mouth feature image blocks, ear feature image blocks, and contour feature image blocks to the corresponding positions of the preset 256×256 pixel standard facial feature map template based on the pet's facial anatomy.

[0097] In this example, the spatial localization algorithm is implemented based on the coordinate system of key points on the pet's face. By detecting the localization key points corresponding to each feature subset (such as the center of the eyes, the tip of the nose, the corners of the mouth, the base of the ears, and the contour boundary points), its relative position on the standard facial template is calculated, and affine transformation is used to place the image blocks into the corresponding areas of the template. This process ensures seamless docking between feature image blocks and conforms to the pet's facial structure, preventing positional misalignment or overlap.

[0098] For example, the center of the eye image block is located at (80, 60) pixels of the template, the center of the nose image block is located at (128, 120), the mouth image block is located at (128, 180), the ear image blocks are located at (50, 30) and (200, 30) respectively, and the contour image block covers the outer perimeter of the template, completing the overall feature map spatial layout.

[0099] The Laplacian pyramid decomposition technique is used to decompose the eye feature image block, nose feature image block, mouth feature image block, ear feature image block and contour feature image block at the corresponding locations into multiple layers. At each decomposition level, the features are fused by weighted averaging and edge-preserving filtering algorithms to obtain the fused multi-layer features.

[0100] In this example, Laplacian pyramid decomposition breaks down each input image patch into several resolution levels, each containing the low-frequency components and detailed textures of the image. By weighted averaging and fusing multiple image patches at the same resolution level, combined with edge-preserving filtering (such as bilateral filtering) to prevent detail loss, a multi-layered fused feature is formed. This method ensures the edge sharpness and integrity of texture details in the fused image.

[0101] For example, the image patches of the eyes and nose are decomposed into three levels of Laplacian pyramids, and then the two are fused by weighted average in the second layer. The weights are dynamically allocated according to the subset integrity score (e.g., 0.6 for the eyes and 0.4 for the nose). The edge-preserving filter is then used to refine the fusion region, and finally, multi-layer fusion features are synthesized.

[0102] The Laplacian pyramid reconstruction technique is used to recombine the fused multi-layer features to obtain a facial feature map.

[0103] In this example, Laplacian pyramid reconstruction generates a high-resolution facial feature map by progressively accumulating low-frequency and high-frequency information from multiple layers of fused features. The reconstruction process ensures a natural transition between image patch fusions, avoiding stitching artifacts and blurred edges. The system employs a weighted fusion strategy, assigning different weights to different feature regions during reconstruction to optimize the overall visual consistency and recognition performance of the facial image.

[0104] For example, by reconstructing the multi-layer fusion features sequentially from bottom to top, a facial feature map of 256×256 pixels is obtained. The image details are clear, and the facial features are accurately restored, which is suitable for subsequent similarity matching and recognition.

[0105] Specifically, step S50 can preferably be implemented in the following embodiment:

[0106] A global feature description set is obtained by extracting features from the facial feature map using a pre-defined deep convolutional neural network.

[0107] In this example, the deep convolutional neural network uses the ResNet-50 architecture as the base model and incorporates transfer learning techniques for fine-tuning training on a pet facial image dataset. The network input is a fixed-size 256×256 pixel facial feature map. After processing through multiple convolutional layers, batch normalization, and activation functions, it outputs a 512-dimensional global feature vector as the facial feature description set. This network structure possesses strong feature extraction capabilities, capturing detailed facial information while maintaining low computational complexity.

[0108] For example, the system forward propagates the input facial feature map through the ResNet-50 model and extracts the output of the intermediate fully connected layer as a global feature description vector. Each component of the vector represents the response intensity of a local region or texture feature of the face, which is used for subsequent similarity calculation.

[0109] The system retrieves standard facial feature images of all registered pets from a pre-defined pet identity database. It then uses a deep convolutional neural network to encode the features of each standard facial feature image in the database, resulting in a corresponding set of standard feature descriptions.

[0110] In this example, each standard facial feature map in the database is processed by the same ResNet-50 deep convolutional neural network model to extract the corresponding 512-dimensional standard feature vector. The database feature vectors are pre-calculated and stored, supporting real-time fast retrieval. This method ensures consistency between the database feature description and the description of the features to be identified, avoiding errors caused by differences in feature extraction models.

[0111] For example, the system retrieves the facial feature map of a registered pet from the database, inputs it into a pre-trained ResNet-50 model, outputs a standard feature description vector, stores it in the feature index library, and directly loads the corresponding feature vector for matching when recognition is needed.

[0112] The similarity between the global feature description set and all standard feature description sets is calculated one by one using a weighted combination of the cosine similarity calculation formula and the Euclidean distance calculation formula, and the similarity score is obtained.

[0113] In this example, the specific calculation steps are as follows:

[0114] Cosine similarity is used to measure the directional similarity between two feature vectors. The formula is as follows:

[0115]

[0116] Where, f1=(f 11 ,f 12 ,…,f 1d ) represents the global feature description vector extracted from the facial feature map to be identified, with a length of d=512; f2=(f 21,f 22 ,…,f 2d ) represents the standard feature description vector corresponding to a standard facial feature map in the database, with a length of 512.

[0117] It is the dot product of two vectors; It is the Euclidean norm (length) of vector f1; It is the Euclidean norm of vector f2.

[0118] The range of cosine similarity values ​​is: The closer the value is to 1, the more similar the directions of the two vectors are.

[0119] Euclidean distance is used to measure the absolute distance between two eigenvectors in numerical space. The formula is as follows:

[0120] ;

[0121] Among them, f 1i and f 2i These are the element values ​​of vectors f1 and f2 in the i-th dimension, respectively;

[0122] The smaller the calculated Euclidean distance value, the closer the two feature vectors are.

[0123] The final similarity score combines the weights of both factors, and the calculation formula is as follows:

[0124] ;

[0125] in, and These are the weight parameters for cosine similarity and Euclidean distance, respectively, satisfying... + =1, for example =0.7, =0.3;

[0126] It is the maximum value of all Euclidean distances in the current database, used to normalize the Euclidean distances and ensure a consistent scoring scale;

[0127] This represents the overall similarity score; the higher the score, the more closely the two feature vectors match.

[0128] This weighted combination method balances the consistency of vector direction with the consideration of numerical differences, thereby improving the accuracy and robustness of the matching.

[0129] For example, assuming the facial feature description vector to be identified is f1, and a standard facial feature description vector in the database is f2, the two are calculated as follows:

[0130] Cosine similarity ;

[0131] Euclidean distance The maximum Euclidean distance in the database Then the normalized Euclidean distance is 15.0 / 25.0 = 0.6;

[0132] Set weight w c =0.7, w e If the similarity score is 0.3, then the final similarity score is:

[0133] 0.7×0.85-0.3×0.6=0.595-0.18=0.415;

[0134] The system sorts pets based on their ratings in the database, and the pet with the highest rating that exceeds a threshold is identified as the pet.

[0135] When the similarity score is greater than the preset identity recognition threshold, the corresponding pet identity will be output as the recognition result.

[0136] In this example, the preset identity recognition threshold is adjusted according to the actual application environment and set between 0.5 and 0.7 to ensure a balance between recognition accuracy and recall. The system filters all calculated scores, selecting the pet identity corresponding to the feature description with the highest score exceeding the threshold as the final recognition result. This process supports real-time output and API calls, facilitating integration into pet management systems.

[0137] For example, when the highest similarity score is 0.62, which exceeds the threshold of 0.6, the system will return the corresponding pet ID "Pet12345" as the recognition result and output the recognition confidence score of 0.62.

[0138] When the similarity score is lower than the identity recognition threshold, an unrecognized status is output and a prompt is made to re-capture the facial image.

[0139] In this example, when the similarity scores of all standard feature description sets are below the threshold, the system determines that the current facial feature map cannot match any registered pet and outputs an "unrecognized" status. The system simultaneously triggers a re-capture process, prompting the user to re-capture multiple frames of pet facial images to obtain more complete and clearer facial features, thereby improving subsequent recognition accuracy.

[0140] For example, if the highest similarity score calculated from the current facial feature map is 0.45, which is lower than the threshold of 0.5, the system will notify the user through a pop-up window that "recognition failed, please re-capture the pet's facial image" and automatically start the camera acquisition module to acquire multiple frames of images.

[0141] like Figure 2As shown, this application also provides a pet identification method apparatus 10, which specifically includes the following modules:

[0142] Acquisition module 11, wherein the acquisition module 11 is mainly used to continuously acquire multiple frames of facial images of the pet, perform facial feature recognition on the facial images, and obtain an image feature set;

[0143] Evaluation module 12, wherein the evaluation module 12 is mainly used to evaluate the integrity of subsets in the image feature set and obtain the integrity score of each subset;

[0144] The fusion module 13 is mainly used to perform feature fusion on the corresponding subsets if the integrity scores of all subsets in a certain feature set of the image feature set are lower than a preset threshold, until a subset with an integrity score higher than the preset threshold appears.

[0145] The generation module 14 is mainly used to extract the subset with the highest integrity score in the image feature set, and to perform image fusion on the subset with the highest score to generate a facial feature map.

[0146] The identification module 15 is mainly used to match the facial feature map with images preset in the database to obtain a similarity score, and identify the corresponding pet identity based on the similarity score.

[0147] In this embodiment, through the division of labor and cooperation of the acquisition module 11, evaluation module 12, fusion module 13, generation module 14 and recognition module 15, a systematic processing flow for the integrity assessment, feature enhancement and identity recognition of pet facial images is realized.

[0148] like Figure 3 As shown, this application also provides an electronic device 20, including a memory 21 and a processor 22. The memory 21 stores a computer program that can run on the processor 22. When the processor 22 executes the computer program, it implements the pet identification method described above.

[0149] In this embodiment, by integrating a memory 21 and a processor 22 into the electronic device 20 and running the computer program on the processor 22, the efficient execution and fully automated deployment of the above-mentioned pet identification method are achieved.

[0150] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when run by a processor, causes the processor to perform the pet identification method as described above.

[0151] In this embodiment, by pre-storing complete pet identification program code in a computer-readable storage medium, the program can be deployed and executed on any compatible device, possessing platform independence and cross-terminal compatibility.

[0152] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0153] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause an electronic device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this application.

[0154] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.

[0155] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for identifying pets, characterized in that, The identification method includes: Multiple frames of facial images of a pet are continuously acquired, and facial feature recognition is performed on the facial images to obtain an image feature set; wherein, the image feature set includes an eye feature set, a nose feature set, a mouth feature set, an ear feature set, and a contour feature set; Integrity assessment is performed on subsets of the image feature set to obtain integrity scores for each subset; If the integrity score of all subsets in a certain feature set of the image feature set is lower than a preset threshold, then feature fusion is performed on the corresponding subsets until a subset with an integrity score higher than the preset threshold appears. The image feature sets are sorted in descending order of integrity score using a scoring and ranking algorithm. The subsets with the highest integrity scores are selected from the eye feature set, nose feature set, mouth feature set, ear feature set, and contour feature set, respectively. In the feature image reconstruction module, a deconvolutional neural network is used to reconstruct the eye feature subset into a 64×64 pixel eye feature image block, the nose feature subset into a 48×48 pixel nose feature image block, the mouth feature subset into a 32×32 pixel mouth feature image block, the ear feature subset into a 40×40 pixel ear feature image block, and so on. A subset of contour features is reconstructed into 80×80 pixel contour feature image blocks; the eye feature image blocks, nose feature image blocks, mouth feature image blocks, ear feature image blocks, and contour feature image blocks are positioned at corresponding positions on a preset 256×256 pixel standard facial feature map template; the Laplacian pyramid decomposition technique is used to perform multi-level decomposition on the eye feature image blocks, nose feature image blocks, mouth feature image blocks, ear feature image blocks, and contour feature image blocks at the corresponding positions, and feature fusion is performed at each decomposition level using weighted averaging and edge-preserving filtering algorithms to obtain fused multi-level features; the fused multi-level features are then recombined using Laplacian pyramid reconstruction technique to obtain a facial feature map; The facial feature map is matched with images preset in the database to obtain a similarity score, and the corresponding pet identity is identified based on the similarity score.

2. The pet identification method according to claim 1, characterized in that, The steps of continuously acquiring multiple frames of facial images of the pet, performing facial feature recognition on the facial images, and obtaining an image feature set include: Several facial images of a pet are captured continuously in multiple frames by a camera. Facial regions are located and cropped from all the facial images to obtain several cropped facial images. The detection algorithm identifies the pupil position, eye shape, and eye texture features of all the cropped facial images to construct an eye feature set; The nose bridge curve, nostril shape, and nose color distribution features of all the cropped facial images are extracted using a contour detection algorithm to construct a nose feature set. The lip contour, mouth opening and closing state, and hair distribution features around the mouth of all the cropped facial images are extracted using an edge detection algorithm to construct a mouth feature set. The ear contour, ear erection status, and ear hair texture features of all the cropped facial images are extracted using a shape recognition algorithm to construct an ear feature set. The overall head shape, facial aspect ratio, and hair distribution of all cropped facial images are extracted using a boundary detection algorithm to construct a contour feature set.

3. The pet identification method according to claim 1, characterized in that, The step of evaluating the integrity of subsets of the image feature set to obtain integrity scores for each subset includes: The degree of feature loss is assessed by calculating the proportion of zero values ​​in each subset of the image feature set, and a loss score is obtained for each subset. The sharpness of the features is evaluated by analyzing the variance and signal-to-noise ratio of each subset in the image feature set, and a sharpness score for each subset is obtained. The consistency of features is evaluated by calculating the correlation and stability between each subset of the image feature set, and a consistency score for each subset is obtained. The completeness score of each subset is obtained by calculating a weighted average of the missingness score, the clarity score, and the consistency score.

4. The pet identification method according to claim 1, characterized in that, The step of performing feature fusion on the corresponding subsets if the integrity scores of all subsets in a certain feature set of the image feature set are lower than a preset threshold, until a subset with an integrity score higher than the preset threshold appears, includes: When it is detected that the integrity scores of all subsets of a certain feature set in the image feature set are all lower than a preset threshold, feature fusion and splicing are performed using the same set data of the subsets that are lower than the preset threshold to obtain the combined subset. The integrity of the combined subset is evaluated and its integrity score is calculated. If the integrity score of the combined subset is still lower than the preset threshold, the fusion and splicing process continues until a subset with an integrity score higher than the preset threshold is generated.

5. The pet identification method according to claim 1, characterized in that, The step of matching the facial feature map with images preset in the database to obtain a similarity score, and identifying the corresponding pet identity based on the similarity score, includes: The facial feature map is processed by a pre-defined deep convolutional neural network to extract features and obtain a global feature description set. The system retrieves standard facial feature images of all registered pets from a pre-defined pet identity database, and encodes the features of each standard facial feature image in the database using the deep convolutional neural network to obtain the corresponding standard feature description set. The similarity between the global feature description set and all the standard feature description sets is calculated one by one using a weighted combination of the cosine similarity calculation formula and the Euclidean distance calculation formula, and a similarity score is obtained. When the similarity score is greater than the preset identity recognition threshold, the corresponding pet identity will be output as the recognition result. When the similarity score is lower than the identity recognition threshold, an unrecognized status is output and a prompt is made to re-capture the facial image.

6. A pet identification method and apparatus, characterized in that, include: The acquisition module is used to continuously acquire multiple frames of facial images of the pet, perform facial feature recognition on the facial images, and obtain an image feature set; wherein, the image feature set includes an eye feature set, a nose feature set, a mouth feature set, an ear feature set, and a contour feature set; An evaluation module is used to evaluate the integrity of subsets of the image feature set and obtain an integrity score for each subset. The fusion module is used to perform feature fusion on the corresponding subsets if the integrity scores of all subsets in a certain feature set of the image feature set are lower than a preset threshold, until a subset with an integrity score higher than the preset threshold appears. The generation module is used to sort all subsets of the image feature set in descending order of integrity score using a scoring and ranking algorithm; and to select the subsets of eye features, nose features, mouth features, ear features, and contour features with the highest integrity scores from the eye feature set, nose feature set, mouth feature set, ear feature set, and contour feature set, respectively. In the feature image reconstruction module, a deconvolutional neural network is used to reconstruct the eye feature subset into a 64×64 pixel eye feature image block, the nose feature subset into a 48×48 pixel nose feature image block, the mouth feature subset into a 32×32 pixel mouth feature image block, and the ear feature subset into a 40×40 pixel ear feature image block. The contour feature subset is reconstructed into 80×80 pixel contour feature image blocks; the eye feature image blocks, nose feature image blocks, mouth feature image blocks, ear feature image blocks, and contour feature image blocks are positioned at corresponding positions on a preset 256×256 pixel standard facial feature map template; the Laplacian pyramid decomposition technique is used to perform multi-level decomposition on the eye feature image blocks, nose feature image blocks, mouth feature image blocks, ear feature image blocks, and contour feature image blocks at the corresponding positions, and feature fusion is performed at each decomposition level using weighted averaging and edge-preserving filtering algorithms to obtain fused multi-level features; the fused multi-level features are then recombined using Laplacian pyramid reconstruction technique to obtain a facial feature map; The recognition module is used to perform similarity matching between the facial feature map and images preset in the database to obtain a similarity score, and to identify the corresponding pet identity based on the similarity score.

7. An electronic device, characterized in that, The device includes a memory and a processor, the memory storing a computer program that can run on the processor, and the processor executing the computer program to implement the pet identification method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, It stores a computer program that, when run by a processor, causes the processor to perform the pet identification method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Sports equipment management personnel identification method, system and equipment

    CN120782378A