CN114387622A - Animal weight recognition method and device, electronic equipment and storage medium - Google Patents

Animal weight recognition method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114387622A
CN114387622A CN202210037435.8A CN202210037435A CN114387622A CN 114387622 A CN114387622 A CN 114387622A CN 202210037435 A CN202210037435 A CN 202210037435A CN 114387622 A CN114387622 A CN 114387622A
Authority
CN
China
Prior art keywords
animal
virtual
image
real
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202210037435.8A
Other languages
Chinese (zh)
Inventor
王旭新
张展鹏
成慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Sensetime Technology Co Ltd
Original Assignee
Shenzhen Sensetime Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Sensetime Technology Co Ltd filed Critical Shenzhen Sensetime Technology Co Ltd
Priority to CN202210037435.8A priority Critical patent/CN114387622A/en
Publication of CN114387622A publication Critical patent/CN114387622A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches

Abstract

The present disclosure relates to an animal re-identification method and apparatus, an electronic device, and a storage medium by determining an animal image sequence including at least two real animal images including a real animal. And inputting each real animal image into the animal detection model to obtain the position information of at least one real animal. And inputting the real animal region corresponding to at least one position information in each real animal image into the feature extraction model to obtain the feature information of the real animal. And matching according to the position information and the characteristic information corresponding to each real animal image to obtain a re-identification result. The animal detection model and the feature extraction model are obtained through training of a virtual training set, and the virtual training set comprises at least one virtual image comprising a virtual animal and labeling positions and identification information of the virtual animal in each virtual image. The detection model and the feature extraction model are obtained through virtual training set training, and detection and tracking of real animals are achieved.

Description

Animal weight recognition method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for identifying an animal weight, an electronic device, and a storage medium.
Background
When the object is re-identified through the deep learning network, a model applied in the re-identification process needs to be trained based on a large number of samples. Because data and class labels of animals are difficult to obtain, the related art is difficult to train to obtain a model for re-identifying the animals.
Disclosure of Invention
The present disclosure provides a method and an apparatus for animal re-identification, an electronic device and a storage medium, and aims to provide a method for re-identifying an animal.
According to a first aspect of the present disclosure, there is provided an animal re-identification method comprising:
determining an animal image sequence comprising at least two real animal images, each of said real animal images comprising at least one real animal;
inputting each real animal image into an animal detection model to obtain the position information of at least one real animal in each real animal image;
inputting a real animal region corresponding to at least one position information in each real animal image into a feature extraction model to obtain feature information of a real animal in the real animal region;
matching according to the position information and the characteristic information corresponding to each real animal image to obtain a re-identification result, wherein the re-identification result comprises at least one category label corresponding to the real animal and the position information corresponding to each category label;
the animal detection model and the feature extraction model are obtained through training of a virtual training set, wherein the virtual training set comprises at least one virtual image comprising a virtual animal, and the labeling position and the identification information of at least one virtual animal in each virtual image.
In a possible implementation manner, the matching according to the position information and the feature information corresponding to each of the real animal images to obtain a re-recognition result includes:
according to the sequence of each real animal image in the animal image sequence, sequentially matching the position information and the characteristic information corresponding to the adjacent real animal images to obtain the same real animal in the adjacent real animal images;
distributing a corresponding category label for each real animal, and determining the position information of the real animal corresponding to each category label in each real animal image according to the same real animal in the adjacent real animal image;
and determining a re-identification result according to the category label representing each real animal and at least one piece of position information corresponding to each category label.
In a possible implementation manner, the sequentially matching the position information and the feature information corresponding to the adjacent real animal images according to the sequence of each real animal image in the animal image sequence to obtain the same real animal in the adjacent real animal images includes:
sequentially determining a reference animal image and a target animal image of a next frame of the reference animal image according to the sequence of each real animal image in the animal image sequence;
determining reference position information and reference characteristic information corresponding to at least one real animal of the reference animal image;
determining target position information and target characteristic information corresponding to at least one real animal of the target animal image;
and for each real animal in the reference animal image, respectively matching each target position information and the corresponding target characteristic information according to the corresponding reference position information and the corresponding reference characteristic information to obtain the same real animal in the target image.
In one possible implementation manner, the determining process of the virtual training set includes:
determining a virtual scene comprising a virtual animal;
acquiring images in the virtual scene through a virtual camera to obtain at least one virtual image comprising the virtual animal;
and determining the labeling position and the identification information of the virtual animal in each virtual image.
In one possible implementation, the determining a virtual scene including a virtual animal includes:
determining a virtual animal model and corresponding attribute information, wherein the virtual animal model is a grid body, and the attribute information comprises appearance information, an animal framework and identification information;
generating a virtual scene;
and importing the virtual animal model into the virtual scene according to the attribute information to obtain the virtual scene comprising the virtual animal, and adjusting the virtual animal model according to the attribute information to determine the virtual animal model.
In a possible implementation manner, the image acquisition in the virtual scene by the virtual camera obtains at least one virtual image including the virtual animal:
determining first motion information corresponding to the virtual animal, wherein the first motion information is used for representing the motion process of the virtual animal in the virtual scene;
determining second motion information corresponding to the virtual camera, wherein the second motion information is used for representing a motion process of the virtual camera in the virtual scene;
in response to starting an image acquisition process, controlling the virtual animal and the virtual camera to move according to the first motion information and the second motion information;
and acquiring images in the motion process of the virtual animal and the virtual camera to obtain at least one virtual image comprising the virtual animal.
In a possible implementation manner, the first motion information includes a plurality of continuous first motion frames for defining the position and the posture of the virtual animal and the second motion information includes a plurality of continuous second motion frames for defining the position and the posture of the virtual camera;
the controlling the virtual animal and the virtual camera to move according to the first motion information and the second motion information includes:
changing the position and the posture of the virtual animal in the virtual scene frame by frame according to a plurality of continuous first action frames;
changing the position and the posture of the virtual camera in the virtual scene from frame to frame according to a plurality of consecutive second motion frames.
In one possible implementation, the virtual camera is further configured to acquire a mask image representing a position of the virtual animal in the virtual scene;
the determining the labeling position and the identification information of the virtual animal in each virtual image comprises:
determining a corresponding labeling position according to a mask image acquired simultaneously with each virtual image;
and acquiring identification information in the attribute information of the virtual animal in each virtual image.
In one possible implementation, the training process of the feature extraction model includes:
taking the area where the virtual animal is in the virtual image in the virtual training set as a sample, and taking the identification information of the virtual animal in the area where each virtual animal is as a true value training classification model, wherein the classification model comprises a feature extraction layer and a classification layer;
and acquiring a feature extraction layer in the classification model obtained by training as a feature extraction model.
According to a second aspect of the present disclosure, there is provided an animal re-identification apparatus comprising:
the sequence determination module is used for determining an animal image sequence comprising at least two real animal images, wherein each real animal image comprises at least one real animal;
the position determining module is used for inputting each real animal image into an animal detection model to obtain the position information of at least one real animal in each real animal image;
the characteristic extraction module is used for inputting a real animal region corresponding to at least one position information in each real animal image into a characteristic extraction model to obtain the characteristic information of a real animal in the real animal region;
the information matching module is used for matching according to the position information and the characteristic information corresponding to each real animal image to obtain a re-identification result, and the re-identification result comprises at least one category label corresponding to a real animal and position information corresponding to each category label;
the animal detection model and the feature extraction model are obtained through training of a virtual training set, wherein the virtual training set comprises at least one virtual image comprising a virtual animal, and the labeling position and the identification information of at least one virtual animal in each virtual image.
In one possible implementation, the information matching module includes:
the information matching submodule is used for sequentially matching the position information and the characteristic information corresponding to the adjacent real animal images according to the sequence of each real animal image in the animal image sequence to obtain the same real animal in the adjacent real animal images;
the label distribution submodule is used for distributing a corresponding category label for each real animal and determining the position information of the real animal corresponding to each category label in each real animal image according to the same real animal in the adjacent real animal image;
and the result determining module is used for determining a re-identification result according to the category label representing each real animal and at least one piece of position information corresponding to each category label.
In one possible implementation, the information matching sub-module includes:
the image determining unit is used for sequentially determining a reference animal image and a target animal image of a next frame of the reference animal image according to the sequence of each real animal image in the animal image sequence;
the first information determining unit is used for determining reference position information and reference characteristic information corresponding to at least one real animal of the reference animal image;
the second information determining unit is used for determining target position information and target characteristic information corresponding to at least one real animal of the target animal image;
and the information matching unit is used for matching each real animal in the reference animal image with each target position information and corresponding target characteristic information respectively according to the corresponding reference position information and the corresponding reference characteristic information to obtain the same real animal in the target image.
In one possible implementation manner, the determining process of the virtual training set includes:
determining a virtual scene comprising a virtual animal;
acquiring images in the virtual scene through a virtual camera to obtain at least one virtual image comprising the virtual animal;
and determining the labeling position and the identification information of the virtual animal in each virtual image.
In one possible implementation, the determining a virtual scene including a virtual animal includes:
determining a virtual animal model and corresponding attribute information, wherein the virtual animal model is a grid body, and the attribute information comprises appearance information, an animal framework and identification information;
generating a virtual scene;
and importing the virtual animal model into the virtual scene according to the attribute information to obtain the virtual scene comprising the virtual animal, and adjusting the virtual animal model according to the attribute information to determine the virtual animal model.
In a possible implementation manner, the image acquisition in the virtual scene by the virtual camera obtains at least one virtual image including the virtual animal:
determining first motion information corresponding to the virtual animal, wherein the first motion information is used for representing the motion process of the virtual animal in the virtual scene;
determining second motion information corresponding to the virtual camera, wherein the second motion information is used for representing a motion process of the virtual camera in the virtual scene;
in response to starting an image acquisition process, controlling the virtual animal and the virtual camera to move according to the first motion information and the second motion information;
and acquiring images in the motion process of the virtual animal and the virtual camera to obtain at least one virtual image comprising the virtual animal.
In a possible implementation manner, the first motion information includes a plurality of continuous first motion frames for defining the position and the posture of the virtual animal and the second motion information includes a plurality of continuous second motion frames for defining the position and the posture of the virtual camera;
the controlling the virtual animal and the virtual camera to move according to the first motion information and the second motion information includes:
changing the position and the posture of the virtual animal in the virtual scene frame by frame according to a plurality of continuous first action frames;
changing the position and the posture of the virtual camera in the virtual scene from frame to frame according to a plurality of consecutive second motion frames.
In one possible implementation, the virtual camera is further configured to acquire a mask image representing a position of the virtual animal in the virtual scene;
the determining the labeling position and the identification information of the virtual animal in each virtual image comprises:
determining a corresponding labeling position according to a mask image acquired simultaneously with each virtual image;
and acquiring identification information in the attribute information of the virtual animal in each virtual image.
In one possible implementation, the training process of the feature extraction model includes:
taking the area where the virtual animal is in the virtual image in the virtual training set as a sample, and taking the identification information of the virtual animal in the area where each virtual animal is as a true value training classification model, wherein the classification model comprises a feature extraction layer and a classification layer;
and acquiring a feature extraction layer in the classification model obtained by training as a feature extraction model.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described method.
According to a fourth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method.
In the embodiment of the disclosure, the detection model and the feature extraction model for re-recognition detection are obtained through virtual training set training, so that the detection and tracking of real animals are realized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 shows a flow diagram of a method of animal re-identification according to an embodiment of the present disclosure;
FIG. 2 illustrates a schematic diagram of a virtual image in accordance with an embodiment of the present disclosure;
FIG. 3 shows a schematic diagram of a mask image according to an embodiment of the present disclosure;
fig. 4 shows a schematic diagram of an animal re-identification method according to an embodiment of the present disclosure;
fig. 5 shows a schematic view of an animal re-identification apparatus according to an embodiment of the present disclosure;
FIG. 6 shows a schematic diagram of an electronic device in accordance with an embodiment of the disclosure;
fig. 7 shows a schematic diagram of another electronic device according to an embodiment of the disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
The animal re-identification method of the embodiment of the present disclosure may be executed by an electronic device such as a terminal device or a server. The terminal device may be any fixed or mobile terminal such as a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, and a wearable device. The server may be a single server or a server cluster of multiple servers. Any electronic device may implement the animal re-identification method of embodiments of the present disclosure by way of a processor invoking computer readable instructions stored in a memory.
In one possible implementation, the disclosed embodiments may be applied to detection and tracking of any animal, for example, detection and tracking of an animal using a home robot or video surveillance device.
Fig. 1 shows a flow chart of an animal re-identification method according to an embodiment of the present disclosure. As shown in fig. 1, the animal re-identification method of the embodiment of the present disclosure may include the following steps S10-S40.
Step S10, determining an animal image sequence comprising at least two real animal images.
In a possible implementation manner, the animal image sequence is determined by the electronic device, and the determining manner may be to receive the animal image sequence transmitted after being acquired by the other device, or to directly acquire the animal image sequence by a built-in or connected image acquisition device. Optionally, the sequence of animal images comprises at least two real animal images, each real animal image comprising at least one real animal. The animal image sequence can continuously acquire at least one real animal through an image acquisition device, and the obtained at least two real animal images are formed in sequence. Or, the plurality of cameras can respectively acquire real animals to obtain real animal images, and then the animal image sequences are obtained according to the acquisition time sequence of the plurality of real animal images.
Optionally, the real animals in the real animal images may be determined according to application scenarios, for example, in an application scenario where birds need to be detected and tracked, the real animals included in the real animal images may be birds, and may be acquired by an outdoor image acquisition device in a zoo, a protected area, or the like. Under the application scene that the pet needs to be detected, the real animal included in the real animal image can be a cat, a dog and the like, and can be acquired through an indoor image acquisition device.
Step S20, inputting each real animal image into an animal detection model to obtain the position information of at least one real animal in each real animal image.
In a possible implementation manner, each real animal image in the animal image sequence is detected to obtain position information of the real animal in each real animal image, and the position information represents the position of the corresponding real animal in the real animal image. That is, the animal image sequence can be detected to obtain the position of the real animal in each real animal image. Optionally, the embodiment of the present disclosure may obtain the position information of at least one real animal in each real animal image by inputting each real animal image into the animal detection model. The animal detection model may be any detection model capable of detecting an object, such as a Region Convolutional Neural network (R-CNN), a Fast Region Convolutional Neural network (Fast R-CNN), and a Fast R-CNN.
Further, each location information also has a corresponding confidence level, which is used to characterize the likelihood of including a real animal in the location information. And when the confidence coefficient is larger than a preset threshold value, determining that the position information comprises the corresponding real animal, and when the confidence coefficient is not larger than the preset threshold value, determining that the position information does not comprise the corresponding real animal.
Alternatively, the animal detection model may be trained using a virtual training set. The virtual training set comprises at least one virtual image comprising a virtual animal, and the labeling position and the identification information of at least one virtual animal in each virtual image. In the training process of the animal detection model, each virtual image is used as a sample, and the labeling position of the virtual animal in each virtual image is used as a true value. That is, the virtual images in the virtual training set are input into the animal detection model, the loss of the animal detection model is determined according to the detection position output by the animal detection model and the labeling position corresponding to the virtual images, and the animal detection model is adjusted according to the loss until the convergence condition is met.
In one possible implementation manner, the virtual training set of the embodiment of the disclosure may be determined by a plurality of virtual images acquired based on virtual software, and the annotation position and the identification information of each virtual image. Optionally, the process of determining the virtual training set may be to first determine a virtual scene including the virtual animal, then perform image acquisition in the virtual scene through the virtual camera to obtain at least one virtual image including the virtual animal, and determine the labeling position and the identification information of the virtual animal in each virtual image. The virtual animal can be a virtual simulation animal generated by virtual data generation software. The virtual scene can be any scene generated by virtual data generation software, such as indoor, street, field and the like. Alternatively, the virtual animal may be a two-dimensional or three-dimensional animal, and the virtual scene may be a two-dimensional or three-dimensional scene. When the virtual animal and the virtual scene are a three-dimensional animal and a three-dimensional scene, the virtual data generation software can be a ghost engine, that is, the three-dimensional virtual scene and the three-dimensional virtual animal can be generated by the ghost engine. Or, a three-dimensional virtual scene and a three-dimensional virtual animal can be generated through other software, and then the virtual scene and the three-dimensional virtual animal are introduced into the illusion engine.
Optionally, the virtual animal model and corresponding attribute information may be determined first in the process of generating the virtual animal and the virtual scene by the virtual data generation software, where the virtual animal model is a mesh body, and the attribute information includes appearance information, an animal skeleton, and identification information. And generating a virtual scene, importing the virtual animal model into the virtual scene according to the attribute information to obtain the virtual scene comprising the virtual animal, and adjusting the virtual animal model according to the attribute information by the virtual animal to determine. The animal skeleton, the appearance information and the grid body in the attribute information can be generated by the same software or different software. The animal skeleton corresponding to the virtual animal model is used as the basis of the motion of the virtual animal and consists of a plurality of points (such as joint points) and edges connecting the points. The appearance information corresponding to the virtual animal model is used for representing the appearance of the virtual animal, and may include hair color, brightness, and patterns, for example. The identification information is used for characterizing the virtual animal, and may be the kind, name, and related person identification of the virtual animal, such as "cat", "dog", "xiaoqiang", and "zhang san pet", etc. The mesh of the virtual animal model is used to characterize the outline of the virtual animal and includes a plurality of keypoints. When the virtual animal model is led into a preset virtual scene according to the attribute information, points in the animal skeleton and a plurality of key points in the grid body can be bound.
Further, the preset virtual scene may be an indoor scene or an outdoor scene, which may include a plurality of scene facilities and corresponding lighting systems. For example, an indoor light source and an outdoor light source are included in an indoor scene, and only an outdoor light source is included in an outdoor scene, while the indoor light source and the outdoor light source diffuse through a window and enter the room. The virtual animal generated based on the above manner and the scene where the virtual animal is located can be changed at will, that is, training images can be acquired by generating various scenes including virtual animals of different hair colors, different types and different postures, so as to obtain a virtual training set with rich animal types and scene types. Meanwhile, the virtual animal and the virtual scene are generated through virtual data generation software, so that the price is low, and the acquisition speed is high.
In one possible implementation, at least one of the virtual camera and the virtual animal is in motion during image acquisition. That is, the image acquisition process may include determining first motion information corresponding to the virtual animal, where the first motion information is used to characterize a motion process of the virtual animal in the virtual scene. And determining second motion information corresponding to the virtual camera, wherein the second motion information is used for representing the motion process of the virtual camera in the virtual scene. In response to starting the image acquisition process, the virtual animal and the virtual camera are controlled to move according to the first motion information and the second motion information. And in the movement process of the virtual animal and the virtual camera, controlling the virtual camera to acquire images to obtain at least one virtual image comprising the virtual animal. Optionally, the image capturing process may be started when a capturing start instruction sent by the user in a human-computer interaction manner is received, the image capturing process may be ended after a preset time length after the image capturing is started, or after both the virtual animal and the virtual camera stop moving, or may also be ended when a capturing end instruction sent by the user in a human-computer interaction manner is received.
Further, the first motion information includes a plurality of continuous first motion frames for defining the position and the posture of the virtual animal, and the second motion information includes a plurality of continuous second motion frames for defining the position and the posture of the virtual camera. Controlling the virtual animal and the virtual camera to move according to the first motion information and the second motion information includes changing a position and a posture of the virtual animal in the virtual scene frame by frame according to a plurality of consecutive first motion frames, and changing a position and a posture of the virtual camera in the virtual scene frame by frame according to a plurality of consecutive second motion frames.
In a possible implementation manner, the process of controlling the movement of the virtual animal and the virtual camera according to the embodiment of the disclosure may also be determined according to a preset first movement track and a preset second movement track, that is, the virtual animal may change the position in the virtual space according to the first movement track when starting image acquisition, and the virtual camera may change the position in the virtual space according to the second movement track. Further, when the virtual animal and the virtual camera change positions and postures frame by frame according to the first motion information and the second motion information, each first motion frame in the first motion information and each second motion frame in the second motion information have corresponding duration information, and the duration information is used for representing the time spent by the virtual animal or the virtual camera to move from the previous motion frame to the current motion frame.
FIG. 2 illustrates a schematic diagram of a virtual image in accordance with an embodiment of the disclosure. As shown in the image, at least one virtual image 20 is obtained after image acquisition by the virtual camera. The virtual image 20 includes a virtual scene background 21 and a virtual animal 22. Since the virtual camera captures images within the virtual scene, the virtual scene background 21 captured in the virtual image 20 may be a partial region or a full region of the virtual scene in which the virtual animal 22 is located.
In one possible implementation manner, after at least one virtual image is acquired, the labeling position and the identification information of the virtual animal in each virtual image are determined. The identification information can be directly obtained through the attribute information of the virtual object in the acquired virtual image. Meanwhile, in the case that the virtual scene and the virtual object of the embodiment of the present disclosure are generated by virtual data generation software such as a ghost engine, based on the characteristics of the virtual data generation software, the virtual camera is further configured to acquire a mask image representing the position of the virtual object in the virtual scene. Alternatively, the mask image may be set in advance by the virtual camera to have pixel values other than 0 for the virtual animal, and the pixel values other than the virtual animal are 0. Namely, a mask image with the pixel values of 0 in the areas except the virtual animal is obtained at the same time of obtaining the training image. Therefore, the annotation position can be acquired at the same time of acquiring the training image, that is, determining the annotation position and the identification information of the virtual animal in each virtual image comprises: and determining a corresponding labeling position according to the mask image which is simultaneously obtained with each virtual image, and obtaining the identification information in the virtual animal attribute information in each virtual image.
Further, the labeling position can also determine the labeling position of the virtual animal in the virtual image according to the position and the posture of the virtual camera when the virtual image is acquired and the position and the posture of the virtual animal when the virtual image is acquired. Specifically, the external parameters of the virtual camera, i.e., the amount of rotation and the amount of offset of the virtual camera in the virtual space, may be determined according to the pose of the virtual camera when the virtual indoor image is captured. And converting the position coordinates of the virtual animal in the virtual space coordinate system into the position coordinates in the camera coordinate system of the virtual camera through the external parameters of the virtual camera. And converting the position coordinates of the virtual animal in the camera coordinate system of the virtual camera into two-dimensional pixel coordinates through the position coordinates of the virtual animal in the camera coordinate system of the virtual camera and the internal parameters of the virtual camera to obtain the marked position of the virtual animal in the virtual image. The internal parameters of the virtual camera can be predetermined and comprise the focal length, the imaging origin and the distortion coefficient of the camera.
Fig. 3 shows a schematic diagram of a mask image according to an embodiment of the present disclosure. As shown in fig. 3, in the case where the virtual camera is also used to acquire a mask image 30 representing the position of the virtual animal in the virtual scene, the mask image 30 includes a black background region 31 and an animal region 32 where the non-black virtual animal is located. Alternatively, the mask image 30 may be directly determined as the annotation position. Alternatively, the pixel coordinates of the animal region 32 in the mask image 30, that is, the pixel position of the mask image where the pixel value is not 0, may be determined as the annotation position.
Step S30, inputting the real animal region corresponding to at least one position information in each real animal image into a feature extraction model to obtain the feature information of the real animal in the real animal region.
In a possible implementation manner, after at least one piece of position information of each real object image is determined, an area represented by each piece of position information is extracted as a real animal area, and the real animal area is input into a feature extraction model obtained through training to obtain feature information of a real animal in the real animal area. Alternatively, the feature information may be represented as a feature vector or a feature map.
Optionally, the feature extraction model is obtained by training a virtual training set, where the virtual training set includes at least one virtual image including a virtual animal, and the labeled position and identification information of the at least one virtual animal in each virtual image. In the training process of the feature extraction model, the area where the virtual animal is located in each virtual image is used as a sample, and the identification information of the virtual animal in the area where the virtual animal is located is used as a true value. The determination process of the virtual training set is the same as that in step S20, and is not described herein again.
Further, in the training process of the feature extraction model, the area where the virtual animal is located in the virtual image in the virtual training set may be used as a sample, and the identification information of the virtual animal in the area where each virtual animal is located may be used as a true value to train the classification model. That is, the region where the virtual animal is located in the virtual image in the virtual training set is input into the classification model, the loss of the classification model is determined according to the classification result output by the classification model and the identification information of the virtual animal in the region where each virtual animal is located, and the classification model is adjusted according to the loss until the convergence condition is met. The classification model comprises a feature extraction layer and a classification layer. And after the training of the classification model is finished, acquiring a feature extraction layer in the classification model obtained by training as a feature extraction model. Alternatively, the classification model may be any image classification model, such as google lenet model, VGG model, ResNet model, AlexNet model, and the like.
And step S40, matching according to the position information and the characteristic information corresponding to each real animal image to obtain a re-identification result.
In a possible implementation manner, after the position information and the feature information of each real animal image in the animal image sequence are determined, information matching is performed according to the position information and the feature information of each real animal image, and a re-recognition result can be obtained. The re-identification result comprises at least one category label corresponding to the real animal and position information corresponding to each category label. Namely, the re-identification result is the position of each real animal in different real animal images included in the animal image sequence, and the re-identification result realizes the detection and tracking of each real animal based on the sequence of the different real animal images.
Optionally, the process of matching the position information and the feature information of the plurality of real animal images to obtain the re-recognition result may include: and according to the sequence of each real animal image in the animal image sequence, sequentially matching the position information and the characteristic information corresponding to the adjacent real animal images to obtain the same real animal in the adjacent real animal images. And allocating a corresponding category label to each real animal, and determining the position information of the real animal corresponding to each category label in each real animal image according to the same real animal in the adjacent real animal image. And determining a re-identification result according to the category label representing each real animal and at least one piece of position information corresponding to each category label.
Further, according to the sequence of each real animal image in the animal image sequence, sequentially matching the position information and the feature information corresponding to the adjacent real animal images to obtain the same real animal in the adjacent real animal images comprises: and sequentially determining a reference animal image and a target animal image of the next frame of the reference animal image according to the sequence of each real animal image in the animal image sequence. And determining reference position information and reference characteristic information corresponding to at least one real animal of the reference animal image, and determining target position information and target characteristic information corresponding to at least one real animal of the target animal image. And for each real animal in the reference animal image, respectively matching each target position information and the corresponding target characteristic information according to the corresponding reference position information and the corresponding reference characteristic information to obtain the same real animal in the target image. That is, the reference animal image is an image of a previous frame of the target animal image adjacent to the target animal image in the animal image sequence, and is used for matching the same real animal with the target animal image.
In one possible implementation, the process of matching according to the reference location information and each target location information may include: and predicting the possible position of the real object in the target animal image according to the position information corresponding to the same real animal in the reference position information and the reference position information in at least one real animal image before the reference animal image in the animal image sequence to obtain predicted position information. And further calculating the intersection ratio of the predicted position information and each target position information representation area, and determining that the reference position information is matched with the target position information when the intersection ratio is greater than a first threshold value, namely that the reference position information and a real object in the target position information may be the same real object. Alternatively, the predicted position information may be determined by means of kalman filtering.
Further, the process of matching according to the reference characteristic information and each target characteristic information may be to directly calculate a similarity between the reference characteristic information and each target characteristic information, for example, calculate a distance between the reference characteristic information and each target characteristic information, and determine that the reference characteristic information matches the target characteristic information when the distance is smaller than a second threshold, that is, the real object corresponding to the reference characteristic information and the real animal corresponding to the target characteristic information may be the same real animal.
Optionally, for reference position information and reference feature information of a reference real animal in the reference animal image, when target position information of a target real object in the target animal image matches with the reference position information and target feature information of the real object matches with the reference feature information, it is determined that the reference real animal and the target real animal are the same real animal.
After the same real animal in the two adjacent real animal images is determined, a corresponding category label is allocated to each real animal, and the position information of the real animal corresponding to each category label in each real animal image is determined according to the same real animal in the adjacent real animal images. The category label uniquely corresponds to each real animal, for example, after the same real animal in each adjacent real animal image is determined, N groups of the same real animals are obtained, and the category labels are determined to be "real animal 1", "real animal 2" to "real animal N" in sequence. And determining a re-identification result according to each category label and the position information of the real animal represented by each category label in each real animal image, so as to realize the detection and tracking of each real animal in the animal image sequence.
Furthermore, the predicted position information of the real image in the (N + 1) th real animal image can be determined according to the position information of each real animal in the first N real animal images in the animal image sequence, and then the position information of the real animal in the (N + 1) th real animal image is matched with the pre-stored position information. Further, matching the feature information corresponding to every two matched real animals in the Nth real animal image and the (N + 1) th real image to determine that the real animals matched with the position information and the feature information are the same real animal. Wherein, the process of determining the predicted position information of the real animal may include: the method comprises the steps of firstly calculating the moving speed according to the position information of the real animal in the first N real animal images in an animal image sequence, and then determining the predicted position information according to the moving speed, the adjacent image acquisition time interval and the position information of the real animal in the Nth real animal image.
Optionally, the moving distance and moving direction of the real animal from the 1 st image to the nth image can be determined according to the position information of the real animal in the first N real animal images in the animal image sequence, and then the moving speed is calculated according to the moving distance and the time required for acquiring the N images. And further, predicting the offset distance from the nth image to the (N + 1) th image real animal according to the speed and the adjacent image acquisition time interval, predicting the offset direction of the (N + 1) th image real animal according to the moving direction, and moving the position information of the nth image to the offset direction by the offset distance to obtain predicted position information.
Fig. 4 shows a schematic diagram of an animal re-identification method according to an embodiment of the present disclosure. As shown in fig. 4, after determining the animal image sequence 40, the electronic device inputs each real animal image in the animal image sequence 40 into the animal detection model 41 to obtain corresponding position information 42. Further, each position information 42 has a corresponding confidence level, and when the corresponding confidence level is greater than a preset threshold value, it is determined that the real animal is included in the position information 42. Extracting the real animal region 43 from each position information 42 including the real animal image, and inputting the real animal region 43 into the feature extraction model 44 to obtain the feature information 45 corresponding to each real animal region 43. And sequentially carrying out information matching 46 on the position information 42 and the characteristic information 45 of at least one real animal of the adjacent real animal images according to the sequence of each real animal image in the animal image sequence 40 to obtain a re-identification result 47.
Further, the information matching process of the embodiment of the present disclosure may also be implemented by a tracker, that is, the processes of the position information matching and the feature information matching are both completed by the tracker. Optionally, after the electronic device determines the animal image sequence, the electronic device obtains position information through an animal detection model, and obtains the feature information of the real animal in the position information with the confidence coefficient greater than the confidence coefficient threshold value through the feature extraction model. And sequentially inputting the position information and the characteristic information of each real animal image in the animal image sequence into a tracker for characteristic matching to obtain a re-identification result.
After receiving the first real animal image, the tracker takes the real animal in each position information as a type of real animal and generates a corresponding type label, and simultaneously determines the position information and the characteristic information corresponding to each type label. After receiving the next frame of real animal image, matching the position information and the characteristic information of each type of real animal in the previous frame according to the position information and the characteristic information of each real animal in the next frame of real animal image. When a real animal is matched with a type of real animal in the previous frame, determining that the position information and the characteristic information corresponding to the real animal in the current frame are matched with the type of real animal, and updating the corresponding relation between the position information and the characteristic information corresponding to the real animal and the type label into the tracker. Meanwhile, when a real animal which is not matched with any real animal in the previous frame exists in the current frame, the real animal is determined to be a new real animal type, a new type label is created, and the new type label and the characteristic information and the position information of the corresponding real animal are updated to the tracker. And outputting at least one piece of position information corresponding to each category label by the tracker as a final re-identification result until all real animals in the animal image sequence are matched.
Based on the manner, the virtual training set with large sample size and rich types is created through the virtual scene and the virtual animal, and the accurate detection model and the accurate feature extraction model are obtained through training according to the virtual training set, so that the efficiency of training the animal detection model and the feature extraction model is improved, and the training cost can be reduced. Furthermore, the animal image sequence is accurately detected and feature extracted through the detection model and the feature extraction model, so that the detection and tracking of real animals are realized, and the accuracy of animal detection and tracking is improved.
It is understood that the above-mentioned method embodiments of the present disclosure can be combined with each other to form a combined embodiment without departing from the logic of the principle, which is limited by the space, and the detailed description of the present disclosure is omitted. Those skilled in the art will appreciate that in the above methods of the specific embodiments, the specific order of execution of the steps should be determined by their function and possibly their inherent logic.
In addition, the present disclosure also provides an animal re-identification apparatus, an electronic device, a computer-readable storage medium, and a program, which can be used to implement any animal re-identification method provided by the present disclosure, and the corresponding technical solutions and descriptions and corresponding descriptions in the methods section are not repeated.
Fig. 5 shows a schematic diagram of an animal re-identification apparatus according to an embodiment of the present disclosure, and as shown in fig. 5, the animal re-identification apparatus of an embodiment of the present disclosure may include a sequence determination module 50, a position determination module 51, a feature extraction module 52, and an information matching module 53.
A sequence determination module 50 for determining an animal image sequence comprising at least two real animal images, each of said real animal images comprising at least one real animal;
a position determining module 51, configured to input each of the real animal images into an animal detection model, so as to obtain position information of at least one real animal in each of the real animal images;
a feature extraction module 52, configured to input a real animal region corresponding to at least one piece of location information in each real animal image into a feature extraction model, so as to obtain feature information of a real animal in the real animal region;
the information matching module 53 is configured to match the position information and the feature information corresponding to each real animal image to obtain a re-recognition result, where the re-recognition result includes at least one category tag corresponding to a real animal and position information corresponding to each category tag;
the animal detection model and the feature extraction model are obtained through training of a virtual training set, wherein the virtual training set comprises at least one virtual image comprising a virtual animal, and the labeling position and the identification information of at least one virtual animal in each virtual image.
In one possible implementation manner, the information matching module 53 includes:
the information matching submodule is used for sequentially matching the position information and the characteristic information corresponding to the adjacent real animal images according to the sequence of each real animal image in the animal image sequence to obtain the same real animal in the adjacent real animal images;
the label distribution submodule is used for distributing a corresponding category label for each real animal and determining the position information of the real animal corresponding to each category label in each real animal image according to the same real animal in the adjacent real animal image;
and the result determining module is used for determining a re-identification result according to the category label representing each real animal and at least one piece of position information corresponding to each category label.
In one possible implementation, the information matching sub-module includes:
the image determining unit is used for sequentially determining a reference animal image and a target animal image of a next frame of the reference animal image according to the sequence of each real animal image in the animal image sequence;
the first information determining unit is used for determining reference position information and reference characteristic information corresponding to at least one real animal of the reference animal image;
the second information determining unit is used for determining target position information and target characteristic information corresponding to at least one real animal of the target animal image;
and the information matching unit is used for matching each real animal in the reference animal image with each target position information and corresponding target characteristic information respectively according to the corresponding reference position information and the corresponding reference characteristic information to obtain the same real animal in the target image.
In one possible implementation manner, the determining process of the virtual training set includes:
determining a virtual scene comprising a virtual animal;
acquiring images in the virtual scene through a virtual camera to obtain at least one virtual image comprising the virtual animal;
and determining the labeling position and the identification information of the virtual animal in each virtual image.
In one possible implementation, the determining a virtual scene including a virtual animal includes:
determining a virtual animal model and corresponding attribute information, wherein the virtual animal model is a grid body, and the attribute information comprises appearance information, an animal framework and identification information;
generating a virtual scene;
and importing the virtual animal model into the virtual scene according to the attribute information to obtain the virtual scene comprising the virtual animal, and adjusting the virtual animal model according to the attribute information to determine the virtual animal model.
In a possible implementation manner, the image acquisition in the virtual scene by the virtual camera obtains at least one virtual image including the virtual animal:
determining first motion information corresponding to the virtual animal, wherein the first motion information is used for representing the motion process of the virtual animal in the virtual scene;
determining second motion information corresponding to the virtual camera, wherein the second motion information is used for representing a motion process of the virtual camera in the virtual scene;
in response to starting an image acquisition process, controlling the virtual animal and the virtual camera to move according to the first motion information and the second motion information;
and acquiring images in the motion process of the virtual animal and the virtual camera to obtain at least one virtual image comprising the virtual animal.
In a possible implementation manner, the first motion information includes a plurality of continuous first motion frames for defining the position and the posture of the virtual animal and the second motion information includes a plurality of continuous second motion frames for defining the position and the posture of the virtual camera;
the controlling the virtual animal and the virtual camera to move according to the first motion information and the second motion information includes:
changing the position and the posture of the virtual animal in the virtual scene frame by frame according to a plurality of continuous first action frames;
changing the position and the posture of the virtual camera in the virtual scene from frame to frame according to a plurality of consecutive second motion frames.
In one possible implementation, the virtual camera is further configured to acquire a mask image representing a position of the virtual animal in the virtual scene;
the determining the labeling position and the identification information of the virtual animal in each virtual image comprises:
determining a corresponding labeling position according to a mask image acquired simultaneously with each virtual image;
and acquiring identification information in the attribute information of the virtual animal in each virtual image.
In one possible implementation, the training process of the feature extraction model includes:
taking the area where the virtual animal is in the virtual image in the virtual training set as a sample, and taking the identification information of the virtual animal in the area where each virtual animal is as a true value training classification model, wherein the classification model comprises a feature extraction layer and a classification layer;
and acquiring a feature extraction layer in the classification model obtained by training as a feature extraction model.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementation thereof may refer to the description of the above method embodiments, and for brevity, will not be described again here.
Embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the above-mentioned method. The computer readable storage medium may be a volatile or non-volatile computer readable storage medium.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described method.
The disclosed embodiments also provide a computer program product comprising computer readable code or a non-transitory computer readable storage medium carrying computer readable code, which when run in a processor of an electronic device, the processor in the electronic device performs the above method.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 6 shows a schematic diagram of an electronic device 800 according to an embodiment of the disclosure. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like terminal.
Referring to fig. 6, electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a Complementary Metal Oxide Semiconductor (CMOS) or Charge Coupled Device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the electronic device 800 to perform the above-described methods.
Fig. 7 shows a schematic diagram of another electronic device 1900 according to an embodiment of the disclosure. For example, the electronic device 1900 may be provided as a server. Referring to fig. 7, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system, such as the Microsoft Server operating system (Windows Server), stored in the memory 1932TM) Graphical user interface based exercises, introduced by apple IncMaking system (Mac OS X)TM) Multi-user, multi-process computer operating system (Unix)TM) Free and open native code Unix-like operating System (Linux)TM) Open native code Unix-like operating System (FreeBSD)TM) Or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The computer program product may be embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
The foregoing description of the various embodiments is intended to highlight various differences between the embodiments, and the same or similar parts may be referred to each other, and for brevity, will not be described again herein.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
If the technical scheme of the application relates to personal information, a product applying the technical scheme of the application clearly informs personal information processing rules before processing the personal information, and obtains personal independent consent. If the technical scheme of the application relates to sensitive personal information, a product applying the technical scheme of the application obtains individual consent before processing the sensitive personal information, and simultaneously meets the requirement of 'express consent'. For example, at a personal information collection device such as a camera, a clear and significant identifier is set to inform that the personal information collection range is entered, the personal information is collected, and if the person voluntarily enters the collection range, the person is regarded as agreeing to collect the personal information; or on the device for processing the personal information, under the condition of informing the personal information processing rule by using obvious identification/information, obtaining personal authorization by modes of popping window information or asking a person to upload personal information of the person by himself, and the like; the personal information processing rule may include information such as a personal information processor, a personal information processing purpose, a processing method, and a type of personal information to be processed.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (12)

1. A method for re-identifying an animal, the method comprising:
determining an animal image sequence comprising at least two real animal images, each of said real animal images comprising at least one real animal;
inputting each real animal image into an animal detection model to obtain the position information of at least one real animal in each real animal image;
inputting a real animal region corresponding to at least one position information in each real animal image into a feature extraction model to obtain feature information of a real animal in the real animal region;
matching according to the position information and the characteristic information corresponding to each real animal image to obtain a re-identification result, wherein the re-identification result comprises at least one category label corresponding to the real animal and the position information corresponding to each category label;
the animal detection model and the feature extraction model are obtained through training of a virtual training set, wherein the virtual training set comprises at least one virtual image comprising a virtual animal, and the labeling position and the identification information of at least one virtual animal in each virtual image.
2. The method according to claim 1, wherein the matching according to the position information and the feature information corresponding to each of the real animal images to obtain the re-recognition result comprises:
according to the sequence of each real animal image in the animal image sequence, sequentially matching the position information and the characteristic information corresponding to the adjacent real animal images to obtain the same real animal in the adjacent real animal images;
distributing a corresponding category label for each real animal, and determining the position information of the real animal corresponding to each category label in each real animal image according to the same real animal in the adjacent real animal image;
and determining a re-identification result according to the category label representing each real animal and at least one piece of position information corresponding to each category label.
3. The method according to claim 2, wherein the sequentially matching the position information and the feature information corresponding to the adjacent real animal images according to the sequence of each real animal image in the animal image sequence to obtain the same real animal in the adjacent real animal images comprises:
sequentially determining a reference animal image and a target animal image of a next frame of the reference animal image according to the sequence of each real animal image in the animal image sequence;
determining reference position information and reference characteristic information corresponding to at least one real animal of the reference animal image;
determining target position information and target characteristic information corresponding to at least one real animal of the target animal image;
and for each real animal in the reference animal image, respectively matching each target position information and the corresponding target characteristic information according to the corresponding reference position information and the corresponding reference characteristic information to obtain the same real animal in the target image.
4. The method according to any one of claims 1-3, wherein the determining of the virtual training set comprises:
determining a virtual scene comprising a virtual animal;
acquiring images in the virtual scene through a virtual camera to obtain at least one virtual image comprising the virtual animal;
and determining the labeling position and the identification information of the virtual animal in each virtual image.
5. The method of claim 4, wherein determining the virtual scene including the virtual animal comprises:
determining a virtual animal model and corresponding attribute information, wherein the virtual animal model is a grid body, and the attribute information comprises appearance information, an animal framework and identification information;
generating a virtual scene;
and importing the virtual animal model into the virtual scene according to the attribute information to obtain the virtual scene comprising the virtual animal, and adjusting the virtual animal model according to the attribute information to determine the virtual animal model.
6. The method according to claim 4 or 5, wherein the image acquisition in the virtual scene by means of a virtual camera results in at least one virtual image comprising the virtual animal:
determining first motion information corresponding to the virtual animal, wherein the first motion information is used for representing the motion process of the virtual animal in the virtual scene;
determining second motion information corresponding to the virtual camera, wherein the second motion information is used for representing a motion process of the virtual camera in the virtual scene;
in response to starting an image acquisition process, controlling the virtual animal and the virtual camera to move according to the first motion information and the second motion information;
and acquiring images in the motion process of the virtual animal and the virtual camera to obtain at least one virtual image comprising the virtual animal.
7. The method of claim 6, wherein the first motion information includes a plurality of consecutive first motion frames defining the virtual animal position and pose of the animal skeleton, and the second motion information includes a plurality of consecutive second motion frames defining the virtual camera position and pose;
the controlling the virtual animal and the virtual camera to move according to the first motion information and the second motion information includes:
changing the position and the posture of the virtual animal in the virtual scene frame by frame according to a plurality of continuous first action frames;
changing the position and the posture of the virtual camera in the virtual scene from frame to frame according to a plurality of consecutive second motion frames.
8. The method according to any of claims 5-7, wherein the virtual camera is further used to obtain a mask image characterizing the position of the virtual animal in the virtual scene;
the determining the labeling position and the identification information of the virtual animal in each virtual image comprises:
determining a corresponding labeling position according to a mask image acquired simultaneously with each virtual image;
and acquiring identification information in the attribute information of the virtual animal in each virtual image.
9. The method according to any one of claims 1 to 7, wherein the training process of the feature extraction model comprises:
taking the area where the virtual animal is in the virtual image in the virtual training set as a sample, and taking the identification information of the virtual animal in the area where each virtual animal is as a true value training classification model, wherein the classification model comprises a feature extraction layer and a classification layer;
and acquiring a feature extraction layer in the classification model obtained by training as a feature extraction model.
10. An animal re-identification apparatus, the apparatus comprising:
the sequence determination module is used for determining an animal image sequence comprising at least two real animal images, wherein each real animal image comprises at least one real animal;
the position determining module is used for inputting each real animal image into an animal detection model to obtain the position information of at least one real animal in each real animal image;
the characteristic extraction module is used for inputting a real animal region corresponding to at least one position information in each real animal image into a characteristic extraction model to obtain the characteristic information of a real animal in the real animal region;
the information matching module is used for matching according to the position information and the characteristic information corresponding to each real animal image to obtain a re-identification result, and the re-identification result comprises at least one category label corresponding to a real animal and position information corresponding to each category label;
the animal detection model and the feature extraction model are obtained through training of a virtual training set, wherein the virtual training set comprises at least one virtual image comprising a virtual animal, and the labeling position and the identification information of at least one virtual animal in each virtual image.
11. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to invoke the memory-stored instructions to perform the method of any of claims 1 to 9.
12. A computer readable storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1 to 9.
CN202210037435.8A 2022-01-13 2022-01-13 Animal weight recognition method and device, electronic equipment and storage medium Withdrawn CN114387622A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210037435.8A CN114387622A (en) 2022-01-13 2022-01-13 Animal weight recognition method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210037435.8A CN114387622A (en) 2022-01-13 2022-01-13 Animal weight recognition method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114387622A true CN114387622A (en) 2022-04-22

Family

ID=81201752

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210037435.8A Withdrawn CN114387622A (en) 2022-01-13 2022-01-13 Animal weight recognition method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114387622A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116259072A (en) * 2023-01-10 2023-06-13 华瑞研能科技(深圳)有限公司 Animal identification method, device, equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116259072A (en) * 2023-01-10 2023-06-13 华瑞研能科技(深圳)有限公司 Animal identification method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109543537B (en) Re-recognition model increment training method and device, electronic equipment and storage medium
CN112991553B (en) Information display method and device, electronic equipment and storage medium
CN111241887B (en) Target object key point identification method and device, electronic equipment and storage medium
CN111666917A (en) Attitude detection and video processing method and device, electronic equipment and storage medium
CN109543536B (en) Image identification method and device, electronic equipment and storage medium
CN112115894B (en) Training method and device of hand key point detection model and electronic equipment
CN113194254A (en) Image shooting method and device, electronic equipment and storage medium
CN112945207B (en) Target positioning method and device, electronic equipment and storage medium
CN113139471A (en) Target detection method and device, electronic equipment and storage medium
CN114387445A (en) Object key point identification method and device, electronic equipment and storage medium
CN110909203A (en) Video analysis method and device, electronic equipment and storage medium
CN114581525A (en) Attitude determination method and apparatus, electronic device, and storage medium
CN113989469A (en) AR (augmented reality) scenery spot display method and device, electronic equipment and storage medium
CN111435422A (en) Motion recognition method, control method and device, electronic device and storage medium
CN113553946A (en) Information prompting method and device, electronic equipment and storage medium
CN114387622A (en) Animal weight recognition method and device, electronic equipment and storage medium
CN112906484A (en) Video frame processing method and device, electronic equipment and storage medium
CN114266305A (en) Object identification method and device, electronic equipment and storage medium
WO2023155350A1 (en) Crowd positioning method and apparatus, electronic device, and storage medium
CN113506324B (en) Image processing method and device, electronic equipment and storage medium
CN113506325B (en) Image processing method and device, electronic equipment and storage medium
WO2022110801A1 (en) Data processing method and apparatus, electronic device, and storage medium
CN113052874B (en) Target tracking method and device, electronic equipment and storage medium
CN114937121A (en) Simulation test method and device, electronic device and storage medium
CN114067085A (en) Virtual object display method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20220422