Identity recognition method and device based on patterns, electronic equipment and storage medium
By marking key points and marking the lateral images of breeding animals, extracting regional images, and training pattern matching models, the problem of identity identification errors caused by high facial features of breeding animals is solved, and efficient and accurate identity recognition is achieved.
Patent Information
- Application Number
- CN202411359569.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-03
AI Technical Summary
In the prior art, the facial features of breeding animals are highly similar, which leads to errors in identity identification. How to improve the accuracy of identity identification of breeding animals has become a technical problem that needs to be solved urgently.
By acquiring side images, key point annotation and identity marking, extracting target key point area images, training the initial pattern matching model, realizing the intelligence of pattern matching, and improving the efficiency and accuracy of identity recognition.
It realizes the rapid and accurate identity identification of the target identification object in the target image, improves the accuracy of identity identification of breeding animals, reduces the workload of manual labeling and redundant information, and improves the recognition speed and accuracy.
Smart Images

Figure CN119251874A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image matching and artificial intelligence technology, and in particular to a pattern-based identity recognition method and device, electronic equipment, and storage medium. Background Art
[0002] Pattern-based identity recognition is a technology that uses computers to utilize the biological body's inherent physiological characteristics (such as fingerprints, irises, facial features, etc.) or behavioral characteristics (such as handwriting, voice, gait, etc.) to perform identity authentication. For example, in financial scenarios, farmed animals can be identified based on their facial features, thereby reducing the probability of farmed insurance fraud.
[0003] Currently, the most common method for identifying farmed animals is to record the facial features of farmed animals and then identify the farmed animals based on the facial features. However, the facial features of farmed animals are highly similar, which makes it easy for errors to occur in the identification of farmed animals. Therefore, how to improve the accuracy of identification of farmed animals has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a pattern-based identity recognition method and device, electronic equipment and storage medium, aiming to improve the accuracy of identity recognition of farmed animals.
[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a pattern-based identity recognition method, the method comprising:
[0006] Acquire a side view image containing a target recognition object;
[0007] Obtaining the identity of the target identification object;
[0008] Annotating key points of the side view image to obtain key points of the object;
[0009] Based on the key points of the object and the identity identifier, the side image is marked to obtain an object part identifier;
[0010] Based on the object key points, performing region extraction on the side image to obtain a target key point region image;
[0011] Based on the target key point area image, a preset initial pattern matching model is trained to obtain a target pattern matching model;
[0012] A target image including the target recognition object is acquired, and identity recognition is performed on the target image based on the target key point area image and the target pattern matching model.
[0013] In some embodiments, the side image includes side pixel points, and the step of labeling key points of the side image to obtain object key points includes:
[0014] Based on a preset key point annotation model, parallel feature extraction is performed on the side image to obtain a first resolution feature and a second resolution feature, wherein the first resolution feature is used to represent the feature of the side image at a high resolution, and the second resolution feature is used to represent the feature of the side image at a low resolution;
[0015] Performing feature fusion on the first resolution feature and the second resolution feature to obtain a fused feature;
[0016] Based on the fusion features, calculating the key point probability distribution data of the side body pixel points;
[0017] Based on the key point probability distribution data, the object key points are screened out from the side pixel points.
[0018] In some embodiments, acquiring a target image containing the target recognition object, and performing identity recognition on the target image based on the target key point area image and the target pattern matching model, includes:
[0019] Performing sideways camera processing on the target recognition object to obtain the target image;
[0020] Based on the target pattern matching model, calculating the image similarity between the target image and the target key point area image;
[0021] Based on the image similarity, similar images are screened out from the target area images;
[0022] Based on the similar image, the identity of the target identification object in the target image is identified to obtain the target identity.
[0023] In some embodiments, the calculating the image similarity between the target image and the target key point region image based on the target pattern matching model includes:
[0024] Extracting key points from the target image to obtain target key points;
[0025] Based on the target key points, determining the target sideways position of the target image;
[0026] Based on the side position of the target, a target area image is screened out from the target key point area image;
[0027] Based on the target pattern matching model, cosine similarity calculation is performed on the target image and the target area image to obtain the image similarity.
[0028] In some embodiments, the extracting a region of the side image based on the key points of the object to obtain a target key point region image includes:
[0029] Performing scale measurement on the side body image to obtain image size;
[0030] determining a reference size based on the image size;
[0031] Based on the reference size and the object key points, the side image is segmented into regions to obtain the target key point region image.
[0032] In some embodiments, the step of performing identity marking on the side image based on the key points of the object and the identity identifier to obtain the object part identifier includes:
[0033] Marking the coordinates of the key points of the object to obtain the coordinates of the key points;
[0034] Based on the key point coordinates, determining a standard sideways position of the sideways image;
[0035] Based on the standard sideways position, the identity mark is changed to obtain the object part mark.
[0036] In some embodiments, obtaining a side view image of a target identification object includes:
[0037] Acquire a standard image of the target recognition object;
[0038] Performing target detection on the standard image to obtain position information of the target recognition object;
[0039] The standard image is scaled based on the position information to obtain the side image.
[0040] To achieve the above-mentioned purpose, a second aspect of the embodiment of the present application proposes a pattern-based identity recognition device, the device comprising:
[0041] An object image acquisition module, used to acquire a side image containing a target recognition object;
[0042] An identity acquisition module, used to acquire the identity of the target identification object;
[0043] A key point marking module, used to mark key points of the side image to obtain key points of the object;
[0044] A side body identity marking module, used to mark the side body image based on the key points of the object and the identity mark to obtain an object part mark;
[0045] A key area extraction module, used for performing area extraction on the side image based on the key points of the object to obtain a target key point area image;
[0046] A matching model training module, used to train a preset initial pattern matching model based on the target key point area image to obtain a target pattern matching model;
[0047] The target image recognition module is used to obtain a target image containing the target recognition object, and perform identity recognition on the target image based on the target key point area image and the target pattern matching model.
[0048] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0049] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0050] The pattern-based identity recognition method and device, electronic device and storage medium proposed in the present application obtain a side image containing a target recognition object in order to obtain a clear pattern image of the target recognition object. Furthermore, the side image is annotated with key points to obtain the object key points, which can reduce the workload of manual annotation, thereby improving the efficiency and consistency of key point annotation. Secondly, the side image is marked with identity tags based on the object key points and identity identifiers to obtain the object part identifiers, laying the foundation for subsequent identity matching and identity recognition. Then, the side image is extracted based on the object key points and a preset key point area extraction model to obtain the target area identifiers. The key point area image is marked, the redundant information in the side image is reduced, and the speed and accuracy of the identity recognition of the target recognition object are improved. According to the target key point area image, the preset initial pattern matching model is trained to obtain the target pattern matching model, and the intelligent pattern matching is realized, thereby improving the efficiency of pattern-based identity recognition. Finally, the target image containing the target recognition object is obtained, and the target image is identified based on the target key point area image and the target pattern matching model. The identity recognition of the target recognition object in the target image can be realized quickly and accurately, and the identity recognition accuracy of the target recognition object in the target image is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 is a flow chart of a pattern-based identity recognition method provided in an embodiment of the present application;
[0052] Figure 2 yes Figure 1 Flow chart of step S101 in FIG.
[0053] Figure 3 yes Figure 1 Flow chart of step S103 in FIG.
[0054] Figure 4 yes Figure 1 Flow chart of step S104 in FIG.
[0055] Figure 5 yes Figure 1 Flow chart of step S105 in FIG.
[0056] Figure 6 yes Figure 1 Flow chart of step S107 in FIG.
[0057] Figure 7 yes Figure 6 Flowchart of step S602 in FIG.
[0058] Figure 8 is a schematic diagram of the structure of a pattern-based identity recognition device provided in an embodiment of the present application;
[0059] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. 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.
[0061] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0063] First, some nouns involved in this application are analyzed:
[0064] Supervised learning: Supervised learning is a machine learning method that uses labeled data sets to train models so that they can predict output results based on input data. Its main benefit is that it can provide accurate predictions and classifications, and is widely used in fields such as image recognition, natural language processing, and financial analysis. With clear input-output relationships, supervised learning can quickly adapt to specific tasks and effectively improve decision-making quality when processing large amounts of data, making it a key technology in many practical applications.
[0065] High-resolution network model: The high-resolution network model is a deep learning model that maintains high-resolution feature representation by connecting high-resolution to low-resolution convolutions in parallel, and enhances high-resolution representation by repeatedly performing multi-scale fusion across parallel convolutions. This model design aims to improve spatial accuracy and performs well in position-sensitive tasks.
[0066] Pattern-based identity recognition is a technology that uses computers to utilize the biological body's inherent physiological characteristics (such as fingerprints, irises, facial features, etc.) or behavioral characteristics (such as handwriting, voice, gait, etc.) to perform identity authentication. For example, in financial scenarios, farmed animals can be identified based on their facial features, thereby reducing the probability of farmed insurance fraud.
[0067] Currently, the most common method for identifying farmed animals is to record the facial features of farmed animals and then identify the farmed animals based on the facial features. However, the facial features of farmed animals are highly similar, which makes it easy for errors to occur in the identification of farmed animals. Therefore, how to improve the accuracy of identification of farmed animals has become a technical problem that needs to be solved urgently.
[0068] Based on this, the embodiments of the present application provide a pattern-based identity recognition method and device, an electronic device and a storage medium, aiming to improve the accuracy of identity recognition of farmed animals.
[0069] The pattern-based identity recognition method and device, electronic device and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the pattern-based identity recognition method in the embodiments of the present application is described.
[0070] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0071] The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. Artificial intelligence software technologies mainly include computer vision technology, robotics technology, pattern-based identity recognition technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0072] The pattern-based identity recognition method provided in the embodiment of the present application relates to the field of image matching and artificial intelligence technology. The pattern-based identity recognition method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements a pattern-based identity recognition method, etc., but is not limited to the above forms.
[0073] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0074] Figure 1is an optional flow chart of the pattern-based identity recognition method provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S107.
[0075] Step S101, obtaining a side view image containing a target recognition object;
[0076] Step S102, obtaining the identity of the target identification object;
[0077] Step S103, marking key points of the side view image to obtain key points of the object;
[0078] Step S104, based on the key points and identity identifiers of the object, the side image is marked to obtain the object part identifier;
[0079] Step S105, performing region extraction on the side image based on the object key points to obtain a target key point region image;
[0080] Step S106, training a preset initial pattern matching model based on the target key point region image to obtain a target pattern matching model;
[0081] Step S107, acquiring a target image containing the target recognition object, and performing identity recognition on the target image based on the target key point area image and the target pattern matching model.
[0082] In steps S101 to S107 shown in the embodiment of the present application, a side image containing a target identification object and an identity identifier of the target identification object are obtained, key points of the side image are annotated to obtain object key points, and then identity marking is performed on the side image based on the object key points and the identity identifier to obtain object part identifiers. Furthermore, based on the object key points, region extraction is performed on the side image to obtain a target key point region image. Secondly, based on the target key point region image, a preset initial pattern matching model is trained to obtain a target pattern matching model. Finally, a target image containing the target identification object is obtained, and identity recognition is performed on the target image based on the target key point region image and the target pattern matching model. Therefore, the present application obtains a side image containing a target identification object in order to obtain a clear pattern image of the target identification object. Further, the side image is annotated with key points to obtain the object key points, which can reduce the workload of manual annotation, thereby improving the efficiency and consistency of key point annotation. Secondly, the side image is marked with identity tags according to the object key points and identity identifiers to obtain the object part identifiers, laying the foundation for subsequent identity matching and identity recognition. Then, according to the object key points and the preset key point area extraction model, the side image is extracted to obtain the target key point area image, which reduces the redundant information in the side image and improves the speed and accuracy of identity recognition of the target identification object. According to the target key point area image, the preset initial pattern matching model is trained to obtain the target pattern matching model, and the intelligent pattern matching is realized, thereby improving the efficiency of pattern-based identity recognition. Finally, a target image containing the target identification object is obtained, and the target image is identified based on the target key point area image and the target pattern matching model. The identity recognition of the target identification object in the target image can be quickly and accurately realized, and the identity recognition accuracy of the target identification object in the target image is improved.
[0083] In step S101 of some embodiments, the target object for identification is a farmed animal with patterns, such as a cow, chicken, duck, etc. The side view image refers to an image obtained by photographing the target object for identification from a side view position.
[0084] The present application can obtain a standard image containing the target identification object by photographing the target identification object sideways, or can query the standard image of the target identification object from a website through a network search, and then crop the standard image to obtain a side image, so as to ensure that the target identification object in each side image is clear and easy to identify.
[0085] For details, see Figure 2 In some embodiments, step S101 may include but is not limited to steps S201 to S203:
[0086] Step S201, obtaining a standard image of the target recognition object;
[0087] Step S202, performing target detection on the standard image to obtain the position information of the target recognition object;
[0088] Step S203: scaling the standard image based on the position information to obtain a side view image.
[0089] In step S201 of some embodiments, the standard image refers to an image containing the side view of the target identification object. It should be noted that the target identification object has different sizes in the standard image, which may easily lead to the target identification object not being clear enough and causing identity recognition errors.
[0090] In step S202 of some embodiments, target detection is performed on the target recognition object in the standard image to clarify the position of the target recognition object in the standard image and obtain position information.
[0091] In step S203 of some embodiments, in order to ensure the clarity of each side image of the target recognition object, the standard image needs to be scaled to ensure that the pattern information in the side image can be accurately obtained.
[0092] In steps S201 to S203 shown in this embodiment, target detection is performed on the standard image of the target identification object to clarify the position information of the target identification object, and then the standard image is scaled according to the position information to obtain a side image, so as to improve the clarity of the target identification object in the side image, thereby improving the accuracy of identity recognition.
[0093] In step S102 of some embodiments, the identity identifier refers to identification information used to identify the identity of the target identification object, such as an identity number, name information, etc.
[0094] The present application can obtain the identity information of the target identification object at the same time as obtaining the side image containing the target identification object, and then label the target identification object based on the identity information, thereby obtaining the identity identification of the target identification object.
[0095] In step S103 of some embodiments, a pre-trained key point annotation model can be used to extract features from a side image containing a target identification object, and then based on the extracted features, key point detection and positioning of the target identification object is performed to identify the key point locations in the target identification object, and the key point locations are annotated to obtain the object key points.
[0096] It is important to know that using a pre-trained key point annotation model to annotate the key points of a side view image can reduce the errors caused by subjective factors in manual annotation, thereby improving the accuracy of the key points of the object and the accuracy of the identity recognition of the target object.
[0097] In one application scenario, taking farmed cattle as an example, after obtaining a side image of the cattle, the side image of the cattle is input into a pre-trained cattle key point annotated image, and key points such as the eye sockets, upper end of the scapula, subscapular joint, anterior and posterior knee joints, junction of the lumbar vertebrae and ribs, hip bone, ischium, and humeral joints of the cattle in the side image can be identified.
[0098] For details, see Figure 3 In some embodiments, step S103 may include but is not limited to steps S301 to S304:
[0099] Step S301, based on a preset key point annotation model, parallel feature extraction is performed on the side image to obtain a first resolution feature and a second resolution feature, wherein the first resolution feature is used to represent the feature of the side image at a high resolution, and the second resolution feature is used to represent the feature of the side image at a low resolution;
[0100] Step S302, fusing the first resolution feature with the second resolution feature to obtain a fused feature;
[0101] Step S303, calculating the key point probability distribution data of the side body pixel points based on the fusion features;
[0102] Step S304: based on the key point probability distribution data, filter out the object key points from the side body pixels.
[0103] In step S301 of some embodiments, the key point annotation model may be a HRNet (Deep High-Resolution Representation Learning for Visual Recognition) model, wherein the HRNet model includes a multi-branch convolutional neural network structure.
[0104] The present application can use the HRNet model to perform multi-branch convolution parallel processing on the input side image, so as to obtain high-resolution features of the side image and low-resolution features of the side image, that is, first resolution features and second resolution features.
[0105] In step S302 of some embodiments, the first resolution feature machine and the second resolution feature are subjected to cross-resolution feature fusion to obtain a fused feature of the side image, which can effectively combine information of different resolutions, thereby improving the accuracy of key point detection in the side image.
[0106] In step S303 and step S304 of some embodiments, after obtaining the fused features, weights are assigned to each fused feature to obtain the attention weight of the fused feature, and then the fused feature is activated and calculated based on the attention weight to obtain the confidence that each side pixel point in the side image is a key point, that is, the key point probability distribution data. Finally, based on the key point probability distribution data, qualified object key points are screened out from the side pixel points.
[0107] In steps S301 to S304 shown in the present embodiment, by utilizing a preset key point annotation model, parallel feature extraction is performed on the side view image to obtain a first resolution feature and a second resolution feature that can capture information of the target recognition object at different scales, and then the first resolution feature and the second resolution feature are feature fused to obtain a fused feature, which can effectively combine information of different resolutions, thereby improving the accuracy of key point detection in the side view image. Furthermore, based on the fused feature, key point probability distribution data of the side view pixel points is calculated, and then based on the key point probability distribution data, the object key points are screened out from the side view pixel points, thereby improving the accuracy of key point detection in the side view image.
[0108] In step S104 of some embodiments, after determining the object key points of the target identification object in the side image, a coordinate system is constructed according to the side pixel points of the side image, and based on the coordinate system, the coordinates of the object key points, i.e., the key point coordinates, are obtained, and then based on the key point coordinates, the side position of the target identification object in the side image is clarified to obtain the standard side position, and the standard side position is combined with the identity identification of the side image to obtain the object part identification of the side image.
[0109] For details, see Figure 4 In some embodiments, step S104 may include but is not limited to steps S401 to S403:
[0110] Step S401, marking the coordinates of the key points of the object to obtain the coordinates of the key points;
[0111] Step S402, determining the standard sideways position of the sideways image based on the key point coordinates;
[0112] Step S403: modify the identity tag based on the standard sideways position to obtain the object part tag.
[0113] In step S401 of an embodiment, a coordinate system may be constructed to clarify the coordinates of each key point of the object and obtain the key point coordinates. It should be noted that the coordinate system may be constructed based on the side view pixel points in the side view image.
[0114] In step S402 of one embodiment, based on the above-mentioned key point coordinates, the relative position of the object key points of the target recognition object can be clarified, thereby clarifying the side position of the side image and obtaining the standard side position. For example, the key point coordinates of the object key points of the forelimbs are (1,1), and the key point coordinates of the object key points of the hind limbs are (6,2), thereby making it clear that the forelimbs are located on the left side of the hind limbs. Therefore, it can be known that the body measurement image is an image taken at the left side of the target recognition object.
[0115] In step S403 of one embodiment, the identity identifier can be changed by splicing the standard side position after the existing identity identifier of the side image, thereby obtaining the object part identifier of the side image. For example, if the identity identifier of the side image is 001 and the standard side position is the left side, the object part identifier can be 001 left side.
[0116] In steps S401 to S403 shown in the present embodiment, the coordinates of the key points of the object are marked to obtain the coordinates of the key points, and then the standard body measurement position of the side image is determined according to the coordinates of the key points. Finally, the identity mark is changed according to the standard body measurement position, so that the object part mark of the side image can be obtained, thereby realizing the identity mark of different side positions of the same target identification object, avoiding the identity recognition failure caused by the inconsistency of the patterns on both sides of the target identification object, and improving the identity recognition accuracy of the target identification object.
[0117] In step S105 of some embodiments, a target key point region image can be obtained by performing region extraction of a specific size on the surrounding area of each object key point.
[0118] For details, see Figure 5 In some embodiments, step S105 may include but is not limited to steps S501 to S503:
[0119] Step S501, measuring the scale of the side image to obtain the image size;
[0120] Step S502, determining a reference size based on the image size;
[0121] Step S503, based on the reference size and the object key points, the side image is segmented into regions to obtain a target key point region image.
[0122] In step S501 and step S502 of some embodiments, the image size of the side image can be obtained by measuring the scale of the side image, and then the width of the reference size is determined according to a preset width ratio and the image size of the side image. For example, if the image size of the side image is 800*600 and the preset width ratio is 1 / 6, the reference size is 133*133.
[0123] In step S503 of some embodiments, random region segmentation is performed on each object key point in the side view image according to the reference size, so as to obtain a target key point region image of the side view image.
[0124] In steps S501 to S503 shown in the present embodiment, the scale of the side image is measured to obtain the image size, and then based on the image size, the reference size of the target key point area image is determined, and the side image is segmented according to the reference size and the object key points to obtain the target key point area image, which can ensure the rationality of the size and clarity of the target key point area image, thereby improving the accuracy of pattern matching.
[0125] In step S106 of some embodiments, the initial pattern matching model may be a deep learning neural network using a self-supervised learning method.
[0126] After obtaining the target key point area image of the side image, the present application can obtain a matching image for training the initial pattern matching model by performing data augmentation processing on the target key point area image, wherein the data augmentation processing includes but is not limited to rotation operations, affine transformation operations and color transformation operations. Furthermore, the matching image and the target key point area image are input together into a preset initial pattern matching model for self-supervised learning, thereby realizing model training of the initial pattern matching model and obtaining the target pattern matching model.
[0127] In step S107 of some embodiments, the target image refers to an image of the target recognition object photographed in a sideways position.
[0128] The present application obtains a target image by receiving an image of a target recognition object without identity information uploaded by a user, wherein the user can obtain an image containing the target recognition object by taking a sideways shot of the target recognition object to be recognized, and further, calculates the similarity between the target image and the above-mentioned target key point area image based on a target pattern matching model, thereby being able to identify the identity of the target recognition object in the target image.
[0129] For details, see Figure 6 In some embodiments, step S107 may include but is not limited to steps S601 to S604:
[0130] Step S601, performing sideways camera processing on the target recognition object to obtain a target image;
[0131] Step S602, calculating the image similarity between the target image and the target key point region image based on the target pattern matching model;
[0132] Step S603, based on the image similarity, similar images are screened out from the target area images;
[0133] Step S604, based on the similar images, identifying the identity of the target identification object in the target image to obtain the target identity.
[0134] In step S601 of some embodiments, a target image of the target recognition object can be obtained by photographing the side of the target recognition object.
[0135] It is important to know that photographing the target object from the side can ensure the clarity of the pattern.
[0136] In step S602 of some embodiments, the target image and the target key point region image are input into the target pattern matching model for matching processing, so as to obtain the image similarity between the target image and each target key point region image.
[0137] For details, see Figure 7 In some embodiments, step S602 may include but is not limited to steps S701 to S704:
[0138] Step S701, extracting key points from the target image to obtain target key points;
[0139] Step S702, determining the target side position of the target image based on the target key points;
[0140] Step S703, based on the side position of the target, filter out the target area image from the target key point area image;
[0141] Step S704: Based on the target pattern matching model, cosine similarity calculation is performed on the target image and the target region image to obtain image similarity.
[0142] In step S701 and step S702 of some embodiments, the target key points are extracted from the target image to obtain the target key points, and then the side position of the target identification object in the target image is determined based on the target key points to obtain the target side position. In detail, the method of extracting key points from the target image to obtain the target key points is similar to the above-mentioned method of annotating key points of the side image to obtain the object key points, so it is not repeated here. The method of determining the target side position of the target image based on the target key points is similar to the above-mentioned method of marking the side image based on the object key points and identity identification to obtain the object part identification, so it is not repeated here.
[0143] In step S703 of some embodiments, the shooting angle of the target image can be determined based on the target sideways position of the target image. Therefore, it is necessary to filter out the target area image that is at the same shooting angle as the target image from the target key point area image, thereby reducing the image matching time of the target image and improving the image matching accuracy of the target image.
[0144] In step S704 of some embodiments, the target pattern matching model is used to calculate the cosine similarity between the target image and each target region image, so as to obtain the image similarity between each target region image and the target image.
[0145] In steps S701 to S704 shown in this embodiment, the target key points are extracted from the target image to obtain the target key points, and then the target side position of the target image is determined based on the target key points. Furthermore, based on the target side position, the target area image is screened out from the target key point area image. Finally, based on the target pattern matching model, the cosine similarity of the target image and the target area image is calculated to obtain the image similarity, which can reduce the image matching time of the target image and improve the image matching accuracy of the target image.
[0146] In step S603 of some embodiments, based on the image similarity between the target image and each target key point region image, an image with the highest image similarity is screened out from the target key point region images as a similar image to the target image.
[0147] In step S604 of some embodiments, the object part identification of the corresponding side image is searched based on the similar images determined above, so as to clarify the target identity of the target recognition object in the target image.
[0148] In steps S601 to S604 shown in the present embodiment, a target image is obtained by performing sideways camera processing on the target recognition object, and then the image similarity between the target image and the target key point area image is calculated based on the target pattern matching model. Furthermore, similar images are screened out from the target area image based on the image similarity, and the identity of the target recognition object in the target image is identified based on the similar images to obtain the target identity, which can speed up the identification speed of the target recognition object and improve the identification accuracy of the target recognition object.
[0149] In an application scenario, taking farmed cattle as an example, each cow in the herd is photographed from both sides to obtain a side image of the cow, and the side image of the cow is marked according to the cow identity information obtained in advance to obtain the cow identity. Further, the key points of the side image of the cow are annotated to obtain the cow key points in the side image, and the side position of the side image of the cow is identified according to the cow key points, and then the above-mentioned cow identity is marked to obtain the cow part identification. Secondly, part of the image around the cow key points is cropped from the side image of the cow as the cow key point area image, and an initial cow pattern matching model is trained according to the cow key point area image to obtain a target cow pattern matching model. Finally, when a target cow image containing a cow without an identity identification is received, the target cow pattern matching model can be used to calculate the similarity between the target cow image and the cow key point area image, thereby realizing the identity recognition of the cow.
[0150] The present application obtains a side image containing a target recognition object so as to obtain a clear pattern image of the target recognition object. Furthermore, the side image is annotated with key points to obtain the object key points, which can reduce the workload of manual annotation, thereby improving the efficiency and consistency of key point annotation. Secondly, the side image is marked with identity tags according to the object key points and identity identifiers to obtain the object part identifiers, laying a foundation for subsequent identity matching and identity recognition. Then, according to the object key points and a preset key point area extraction model, the side image is extracted to obtain a target key point area image, which reduces redundant information in the side image and improves the speed and accuracy of identity recognition of the target recognition object. According to the target key point area image, a preset initial pattern matching model is trained to obtain a target pattern matching model, and the pattern matching is intelligentized, thereby improving the efficiency of pattern-based identity recognition. Finally, a target image containing the target recognition object is obtained, and based on the target key point area image and the target pattern matching model, the target image is identified, which can quickly and accurately realize the identity recognition of the target recognition object in the target image, and improve the accuracy of identity recognition of the target recognition object in the target image.
[0151] See also Figure 8 The embodiment of the present application further provides a pattern-based identity recognition device, which can implement the above-mentioned pattern-based identity recognition method, and the device includes:
[0152] The object image acquisition module 801 is used to acquire a side image containing a target recognition object;
[0153] An identity acquisition module 802 is used to acquire the identity of a target identification object;
[0154] A key point marking module 803 is used to mark key points of the side image to obtain key points of the object;
[0155] A side body identity marking module 804 is used to mark the side body image based on the key points and identity of the object to obtain the object part identification;
[0156] The key area extraction module 805 is used to extract the area of the side image based on the key points of the object to obtain a target key point area image;
[0157] The matching model training module 806 is used to train a preset initial pattern matching model based on the target key point area image to obtain a target pattern matching model;
[0158] The target image recognition module 807 is used to obtain a target image containing a target recognition object, and perform identity recognition on the target image based on the target key point area image and the target pattern matching model.
[0159] The specific implementation of the pattern-based identity recognition device is basically the same as the specific implementation of the pattern-based identity recognition method described above, and will not be repeated here.
[0160] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned pattern-based identity recognition method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.
[0161] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0162] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0163] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the pattern-based identity recognition method of the embodiment of this application;
[0164] Input / output interface 903, used to implement information input and output;
[0165] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0166] A bus 905 that transmits information between the various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0167] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0168] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned pattern-based identity recognition method is implemented.
[0169] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0170] The pattern-based identity recognition method, pattern-based identity recognition device, electronic device and storage medium provided in the embodiments of the present application obtain a side image containing a target identification object and an identity identifier of the target identification object, annotate the key points of the side image to obtain the object key points, and then mark the side image according to the object key points and the identity identifier to obtain the object part identifier. Furthermore, according to the object key points, the side image is subjected to region extraction to obtain a target key point region image. Secondly, according to the target key point region image, a preset initial pattern matching model is trained to obtain a target pattern matching model. Finally, a target image containing the target identification object is obtained, and the target image is subjected to identity recognition based on the target key point region image and the target pattern matching model.
[0171] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0172] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0173] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0174] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0175] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0176] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0177] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0178] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0179] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0180] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0181] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A pattern-based identity recognition method, characterized in that: The method comprises: Acquire a side view image containing a target recognition object; Obtaining the identity of the target identification object; Annotating key points of the side view image to obtain key points of the object; Based on the key points of the object and the identity identifier, the side image is marked to obtain an object part identifier; Based on the object key points, performing region extraction on the side image to obtain a target key point region image; Based on the target key point area image, a preset initial pattern matching model is trained to obtain a target pattern matching model; A target image including the target recognition object is acquired, and identity recognition is performed on the target image based on the target key point area image and the target pattern matching model.
2. The method according to claim 1, characterized in that The side image includes side pixel points, and the key point labeling of the side image to obtain the object key points includes: Based on a preset key point annotation model, parallel feature extraction is performed on the side image to obtain a first resolution feature and a second resolution feature, wherein the first resolution feature is used to represent the feature of the side image at a high resolution, and the second resolution feature is used to represent the feature of the side image at a low resolution; Performing feature fusion on the first resolution feature and the second resolution feature to obtain a fused feature; Based on the fusion features, calculating the key point probability distribution data of the side body pixel points; Based on the key point probability distribution data, the object key points are screened out from the side pixel points.
3. The method according to claim 1, characterized in that The step of acquiring a target image containing the target recognition object and performing identity recognition on the target image based on the target key point area image and the target pattern matching model includes: Performing sideways camera processing on the target recognition object to obtain the target image; Based on the target pattern matching model, calculating the image similarity between the target image and the target key point area image; Based on the image similarity, similar images are screened out from the target area images; Based on the similar image, the identity of the target identification object in the target image is identified to obtain the target identity.
4. The method according to claim 3, characterized in that The calculating the image similarity between the target image and the target key point area image based on the target pattern matching model includes: Extracting key points from the target image to obtain target key points; Based on the target key points, determining the target sideways position of the target image; Based on the side position of the target, filtering out a target area image from the target key point area image; Based on the target pattern matching model, cosine similarity calculation is performed on the target image and the target area image to obtain the image similarity.
5. The method according to claim 1, characterized in that The step of performing region extraction on the side image based on the object key points to obtain a target key point region image comprises: Performing scale measurement on the side body image to obtain image size; determining a reference size based on the image size; Based on the reference size and the object key points, the side image is segmented into regions to obtain the target key point region image.
6. The method according to any one of claims 1 to 5, characterized in that: The step of marking the side image based on the key points of the object and the identity identifier to obtain the object part identifier includes: Marking the coordinates of the key points of the object to obtain the coordinates of the key points; Based on the key point coordinates, determining a standard sideways position of the sideways image; Based on the standard sideways position, the identity mark is changed to obtain the object part mark.
7. The method according to any one of claims 1 to 5, characterized in that: The step of obtaining a side view image of a target recognition object comprises: Acquire a standard image of the target recognition object; Performing target detection on the standard image to obtain position information of the target recognition object; The standard image is scaled based on the position information to obtain the side image.
8. A pattern-based identity recognition device, characterized in that: The device comprises: An object image acquisition module, used to acquire a side image containing a target recognition object; An identity acquisition module, used to acquire the identity of the target identification object; A key point marking module, used to mark key points of the side image to obtain key points of the object; A side body identity marking module, used to mark the side body image based on the key points of the object and the identity mark to obtain an object part mark; A key area extraction module, used for performing area extraction on the side image based on the key points of the object to obtain a target key point area image; A matching model training module, used to train a preset initial pattern matching model based on the target key point area image to obtain a target pattern matching model; The target image recognition module is used to obtain a target image containing the target recognition object, and perform identity recognition on the target image based on the target key point area image and the target pattern matching model.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the pattern-based identity recognition method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the pattern-based identity recognition method according to any one of claims 1 to 7 is implemented.
