Object recognition method, device and electronic system

By deforming and filling the image and extracting object features, it solves the problem of high recognition complexity in pedestrian re-identification, achieves efficient recognition when image parts are incomplete, and is suitable for large-scale deployment.

CN113673308BActive Publication Date: 2024-09-06BEIJING KUANGSHI TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110756923.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-05
Publication Date
2024-09-06
Estimated Expiration
2041-07-05

AI Technical Summary

Technical Problem

In pedestrian re-identification, the existing technology has high recognition complexity due to apparent information deviation and large-area missing in the image, making it difficult to deploy on a large scale. Especially in the comparison of full-body images and half-body images, repeated cropping and feature extraction are required. resulting in higher computational complexity.

Method used

By deforming and filling the image, the relative position of the visible parts of the target object in the image meets specified standards, thereby extracting object features for identification, reducing computational complexity, and is suitable for large-scale deployment.

Benefits of technology

It realizes object recognition when image parts are incomplete, reduces computational complexity, avoids local segmentation and repeated feature extraction, and improves the scalability and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113673308B
    Figure CN113673308B
Patent Text Reader

Abstract

The present invention provides an object recognition method, device and electronic system, which obtain a first image containing a target object; if the visible part of the target object in the first image does not contain all the parts of the target object, the first image is deformed and filled so that the relative position of the visible part of the target object contained in the first image meets a specified standard; and the object features of the target object are extracted from the processed first image to further identify the target object. In this method, when the part of the target object in the image is incomplete, the image is deformed and filled so that the relative position of each part of the target object in the image matches the relative position when the image contains the complete part of the target object, and the object features of the target object are directly extracted from the processed image to identify the target object, without the need for local segmentation and recognition of each part, thereby reducing the computational complexity of object recognition and facilitating large-scale deployment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an object recognition method, device and electronic system. Background Art

[0002] When re-identifying pedestrians, it is necessary to compare the similarities of different pedestrian images. If the pedestrian in the image is occluded, a large area of ​​the pedestrian's body area is missing, and the apparent information of the image will be greatly deviated, making it difficult to match with the normal pedestrian image. In the related art, the image can be divided into multiple local small images, and the identification features of each local small image are extracted one by one, and then the identification features of each extracted local small image are combined to represent the entire image. Due to the large number of extracted identification features, the complexity of the distance calculation between samples is high, and this method usually needs to rely on a model that can accurately predict local visibility, resulting in a high complexity of the model and cannot be deployed on a large scale. In the related art, in the comparison of the full-body image and the half-body image, the full-body image can also be cropped according to the visibility of the half-body image, and then the deep recognition model is used to compare the two. This method requires repeated cropping and re-extraction of features for different half-body images and full-body images, resulting in high computational complexity and is also difficult to deploy on a large scale. Summary of the invention

[0003] The object of the present invention is to provide an object recognition method, device and electronic system to reduce the complexity of object recognition in an image and facilitate large-scale deployment.

[0004] The present invention provides an object recognition method, which includes: acquiring a first image containing a target object; if the visible part of the target object in the first image does not contain all parts of the target object, deforming and filling the first image so that the relative position of the visible part of the target object contained in the first image in the first image meets a specified standard; the specified standard includes: when the first image contains all parts of the target object, the relative position of the visible part in the first image; extracting object features of the target object from the processed first image, and recognizing the target object based on the object features.

[0005] Furthermore, if the visible part of the target object in the first image does not include all parts of the target object, the first image is deformed and filled so that the relative position of the visible part of the target object contained in the first image meets the specified standard. The step includes: inputting the first image into a pre-trained first neural network model, identifying the visible part of the target object in the first image through the first neural network model, and determining the visible area ratio and filling boundary marker of the first image based on the visible part; wherein the filling boundary marker is used to: indicate the position of the invisible part of the target object in the first image; if the visible area ratio is less than 1, it is determined that the visible part of the target object in the first image does not include all parts of the target object, and based on the visible area ratio and the filling boundary marker, the first image is deformed and filled so that the relative position of the visible part of the target object contained in the first image meets the specified standard.

[0006] Furthermore, based on the visible area ratio and the fill boundary marker, the first image is deformed and filled so that the relative position of the visible part of the target object contained in the first image meets the specified standard. The steps include: based on the visible area ratio, adjusting the size of the first image so that the relative position of the visible part of the target object contained in the first image meets the specified standard; based on the fill boundary marker, filling the area corresponding to the invisible part of the first image after the size adjustment to restore the size of the first image to the size before the size adjustment.

[0007] Furthermore, based on the visible area ratio and the filling boundary marker, the first image is deformed and filled so that the relative position of the visible part of the target object contained in the first image meets the specified standard. The steps include: filling the area corresponding to the invisible part of the first image based on the visible area ratio and the filling boundary marker; adjusting the size of the first image after the filling process to restore the size of the first image after the filling process to the size before the filling process, and the relative position of the visible part of the target object contained in the adjusted first image in the adjusted first image meets the specified standard.

[0008] Furthermore, object features of the target object are extracted from the processed first image, and the step of identifying the target object based on the object features includes: extracting object features of the target object from the processed first image through a second neural network model; wherein the object features include features of visible parts of the target object; calculating a feature distance between the object features of the target object and the object features of a specified object in a preset reference image, and determining whether the target object and the specified object are the same object.

[0009] Furthermore, the pre-trained first neural network model is determined in the following manner: obtaining a first sample image including all parts of the first object; cropping a specified area in the first sample image including at least a part of the first object to obtain a second sample image, as well as a cropping ratio and a reference fill boundary marker of the second sample image; inputting the second sample image into the initial first neural network model to output an initial visible area ratio and an initial fill boundary marker of the second sample image through the initial first neural network model; determining a first loss value based on the initial visible area ratio, the initial fill boundary marker, the cropping ratio, and the reference fill boundary marker, and updating the weight parameters of the initial first neural network model based on the first loss value; and continuing to execute the step of obtaining the first sample image including all parts of the first object until the initial first neural network model converges to obtain the first neural network model.

[0010] Furthermore, the pre-trained first neural network model is determined in the following manner: obtaining a third sample image containing the second object, and a detection frame of all parts and a detection frame of visible parts corresponding to the second object; inputting the third sample image into the initial first neural network model to output a first detection frame containing all parts and a second detection frame containing visible parts corresponding to the second object through the initial first neural network model, and determining an initial visible area ratio and an initial filling boundary mark of the second object based on the first detection frame and the second detection frame; determining a second loss value based on the initial visible area ratio, the initial filling boundary mark, the detection frame of all parts and the detection frame of visible parts, and updating the weight parameters of the initial first neural network model based on the second loss value; continuing to execute the step of obtaining the third sample image containing the second object until the initial first neural network model converges to obtain the first neural network model.

[0011] Furthermore, the second neural network model is determined in the following manner: obtaining a fourth sample image including all parts of the third object and target features of the third object; cropping a designated area in the fourth sample image including at least a portion of the third object to obtain a fifth sample image; performing filling processing on the fifth sample image to obtain a sixth sample image; wherein the relative position of the designated part of the third object in the sixth sample image matches the relative position of the designated part of the third object in the fourth sample image; inputting the sixth sample image into the initial second neural network model to output the initial features of the third object in the sixth sample image through the initial second neural network model; determining a third loss value based on the initial features and the target features, and updating the weight parameters of the initial second neural network model based on the third loss value; and continuing to execute the step of obtaining the fourth sample image including all parts of the third object until the initial second neural network model converges to obtain the second neural network model.

[0012] The present invention provides an object recognition device, which includes: an acquisition module, used to acquire a first image containing a target object; a processing module, used to deform and fill the first image if the visible part of the target object in the first image does not contain all the parts of the target object, so that the relative position of the visible part of the target object contained in the first image in the first image meets a specified standard; the specified standard includes: when the first image contains all the parts of the target object, the relative position of the visible part in the first image; and a recognition module, used to extract the object features of the target object from the processed first image, and recognize the target object based on the object features.

[0013] The present invention provides an electronic system, which includes: a processing device and a storage device; the storage device stores a computer program, and the computer program executes any one of the above-mentioned object recognition methods when the processing device is running.

[0014] The present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processing device, the steps of any one of the above-mentioned object recognition methods are executed.

[0015] The object recognition method, device and electronic system provided by the present invention first obtain a first image containing a target object; if the visible part of the target object in the first image does not contain all the parts of the target object, the first image is deformed and filled so that the relative position of the visible part of the target object contained in the first image in the first image meets a specified standard; the specified standard includes: when the first image contains all the parts of the target object, the relative position of the visible part in the first image; finally, the object features of the target object are extracted from the processed first image, and the target object is identified based on the object features. In this method, when the part of the target object in the image is incomplete, the image is deformed and filled so that the relative position of each part of the target object in the image matches the relative position when the image contains the complete part of the target object, and the object features of the target object are directly extracted from the processed image to identify the target object, without the need for local segmentation and identification of each part, thereby reducing the computational complexity of object recognition and facilitating large-scale deployment. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1A schematic diagram of the structure of an electronic system provided by an embodiment of the present invention;

[0018] Figure 2 A flowchart of an object recognition method provided by an embodiment of the present invention;

[0019] Figure 3 A flowchart of another object recognition method provided by an embodiment of the present invention;

[0020] Figure 4 A flowchart of another object recognition method provided by an embodiment of the present invention;

[0021] Figure 5 A schematic diagram of an image preprocessing process provided by an embodiment of the present invention;

[0022] Figure 6 A schematic diagram of the structure of an object recognition device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0023] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] In recent years, research on computer vision, deep learning, machine learning, image processing, image recognition and other technologies based on artificial intelligence has made important progress. Artificial Intelligence (AI) is an emerging science and technology that studies and develops theories, methods, technologies and application systems for simulating and extending human intelligence. Artificial intelligence is a comprehensive discipline involving many types of technologies such as chips, big data, cloud computing, the Internet of Things, distributed storage, deep learning, machine learning, neural networks, etc. Computer vision, as an important branch of artificial intelligence, specifically allows machines to recognize the world. Computer vision technology usually includes face recognition, liveness detection, fingerprint recognition and anti-counterfeiting verification, biometric recognition, face detection, pedestrian detection, target detection, pedestrian recognition, image processing, image recognition, image semantic understanding, image retrieval, text recognition, video processing, video content recognition, behavior recognition, 3D reconstruction, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), computational photography, robot navigation and positioning and other technologies. With the research and advancement of artificial intelligence technology, this technology has been applied in many fields, such as security, urban management, traffic management, building management, park management, facial access, facial attendance, logistics management, warehouse management, robots, intelligent marketing, computational photography, mobile phone imaging, cloud services, smart homes, wearable devices, unmanned driving, automatic driving, smart medical care, facial payment, facial unlocking, fingerprint unlocking, identity verification, smart screens, smart TVs, cameras, mobile Internet, live streaming, beauty, makeup, medical beauty, and smart temperature measurement.

[0025] Person re-identification is a technology that uses computer vision technology to determine whether a specific pedestrian exists in an image or video sequence. When re-identifying a person, it is necessary to compare the similarities of different pedestrian images. If there is a large deviation in the apparent information of the image, it is difficult to match it with a normal pedestrian image, where the normal pedestrian image may include a full-body image of the pedestrian. In related technologies, an image can be divided into multiple local small images, and the identification features of each local small image are extracted one by one, and combined into full-body identification features to represent the entire image. This method usually needs to rely on a model that can accurately predict local visibility, such as a posture estimation model, a human body parsing model, etc. Since the model requires a high accuracy, to achieve the corresponding accuracy, the model needs to have a higher model depth and complexity than the normal model, resulting in a high complexity of the model. In addition, in the process of using the combined full-body recognition features to calculate the distance with the features of the normal pedestrian image and confirming the similarity, due to the large number of extracted recognition features, the complexity of the distance calculation between samples is also high, and it cannot be deployed on a large scale; in the comparison of the full-body image and the half-body image, the related technology can crop the full-body image according to the visibility of the half-body image, and then use the deep recognition model to compare the two. This method requires repeated cropping and re-extraction of features for different half-body images and full-body images, and multiple cropping and splicing of the feature maps generated in the middle of the model, resulting in higher computational complexity and more difficult to deploy on a large scale. Based on this, the embodiment of the present invention provides an object recognition method, device and electronic system. The technology can be applied to applications for recognizing objects in images. The technology can be implemented using corresponding software and hardware. The embodiment of the present invention is described in detail below.

[0026] Embodiment 1:

[0027] First, refer to Figure 1 An exemplary electronic system 100 for implementing the object recognition method, apparatus, and electronic system according to the embodiments of the present invention is described.

[0028] like Figure 1 The electronic system 100 includes one or more processing devices 102, one or more storage devices 104, an input device 106, an output device 108, and one or more image acquisition devices 110. These components are interconnected via a bus system 112 and / or other forms of connection mechanisms (not shown). It should be noted that Figure 1 The components and structure of the electronic system 100 shown are merely exemplary and non-limiting. The electronic system may also have other components and structures as required.

[0029] The processing device 102 may be a gateway, or an intelligent terminal, or a device including a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities. It may process data of other components in the electronic system 100, and may also control other components in the electronic system 100 to perform desired functions.

[0030] The storage device 104 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processing device 102 may run the program instructions to implement the client functions and / or other desired functions in the embodiments of the present invention (implemented by the processing device) described below. Various applications and various data, such as various data used and / or generated by the application, may also be stored in the computer-readable storage medium.

[0031] The input device 106 may be a device used by a user to input instructions, and may include one or more of a keyboard, a mouse, a microphone, a touch screen, and the like.

[0032] The output device 108 may output various information (eg, images or sounds) to the outside (eg, a user), and may include one or more of a display, a speaker, and the like.

[0033] The image acquisition device 110 may acquire preview video frames or image data, and store the acquired preview video frames or image data in the storage device 104 for use by other components.

[0034] Exemplarily, the components in the example electronic system for implementing the object recognition method, device, and electronic system according to the embodiment of the present invention can be integrated or dispersed, such as integrating the processing device 102, the storage device 104, the input device 106, and the output device 108 into one body, and setting the image acquisition device 110 at a specified position where the target image can be acquired. When the components in the above electronic system are integrated, the electronic system can be implemented as a smart terminal such as a camera, a smart phone, a tablet computer, a computer, a vehicle-mounted terminal, etc.

[0035] Embodiment 2:

[0036] This embodiment provides an object recognition method, which is executed by a processing device in the above electronic system; the processing device can be any device or chip with data processing capabilities. The processing device can process the received information independently, or it can be connected to a server to jointly analyze and process the information, and upload the processing results to the cloud. Figure 2 As shown, the method comprises the following steps:

[0037] Step S202: acquiring a first image containing a target object.

[0038] The target object may be a person, an animal or any other object; the first image may be a photo, a picture or a video image containing the target object. For the sake of convenience, taking the target object as a pedestrian as an example, the first image may contain all body parts of the pedestrian, or may only contain part of the body parts of the pedestrian. If the first image contains all body parts of the pedestrian, the first image is a full-body image of the pedestrian; if the first image only contains part of the body parts of the pedestrian, for example, only the head and upper body of the pedestrian, the first image is a half-body image of the pedestrian. In actual implementation, when it is necessary to identify the target object, it is usually necessary to first obtain a first image containing the target object, such as a photo, a picture or a video image containing part or all of the body parts of the target object.

[0039] Step S204, if the visible part of the target object in the first image does not include all the parts of the target object, deform and fill the first image so that the relative position of the visible part of the target object included in the first image meets the specified standard; the specified standard includes: when the first image includes all the parts of the target object, the relative position of the visible part in the first image.

[0040] The above-mentioned visible parts can be understood as the parts of the target object displayed in the first image. For example, if the target object is a pedestrian and the first image is a half-body image of the pedestrian, the visible parts of the pedestrian in the first image may only include the head and the upper body, etc.; the above-mentioned all parts can be understood as all parts of the target object. For example, still taking the target object as a pedestrian as an example, the all parts of the pedestrian can be understood as all body parts, including the head, the upper body and the lower body, etc. The above-mentioned deformation processing of the first image can be understood as the process of adjusting the display size of the first image, such as reducing the first image to reduce the size of the first image, etc.; the above-mentioned filling processing can be understood as filling a preset value on any one or more sides of the left side, the right side, the upper side and the lower side of the image boundary, and the size of the image can be changed by filling the preset data; the relative position of the above-mentioned visible parts in the first image can include: the upper half, the lower half, the left half or the right half of the visible parts in the first image, etc. In actual implementation, if the visible part of the target object in the first image does not include all the parts of the target object, considering that when the first image includes all the parts of the target object, the relative positions of the corresponding visible parts in the first image are usually different, therefore, the first image can be deformed and filled so that the relative positions of the visible parts of the target object contained in the processed first image in the first image match the relative positions of the corresponding visible parts in the first image when the first image includes all the parts of the target object; for example, if the first image is a half-body image including the head and upper body of a pedestrian, the half-body image can be compressed and filled, and the relative positions of the head and upper body of the pedestrian in the processed half-body image in the first image are the same or aligned with the relative positions of the head and upper body of the pedestrian in the first image when the first image includes all the body parts of the pedestrian, and the corresponding sizes of the head and upper body can also usually be the same.

[0041] Step S206: extracting object features of the target object from the processed first image, and identifying the target object based on the object features.

[0042] The above-mentioned object features can be understood as the relevant features of the target object. For example, taking the target object as a pedestrian, the object features of the pedestrian may include the pedestrian's gender features, age features, clothing color features or appearance features, etc.; in actual implementation, after the acquired first image is deformed and filled, the corresponding object features of the target object can be extracted from the processed first image, and then the target object can be identified based on the extracted object features.

[0043] The object recognition method provided by the embodiment of the present invention first obtains a first image containing a target object; if the visible part of the target object in the first image does not contain all the parts of the target object, the first image is deformed and filled so that the relative position of the visible part of the target object contained in the first image in the first image meets a specified standard; the specified standard includes: when the first image contains all the parts of the target object, the relative position of the visible part in the first image; finally, the object features of the target object are extracted from the processed first image, and the target object is identified based on the object features. In this method, when the part of the target object in the image is incomplete, the image is deformed and filled so that the relative position of each part of the target object in the image matches the relative position when the image contains the complete part of the target object, and the object features of the target object are directly extracted from the processed image to identify the target object, without the need for local segmentation and identification of each part, thereby reducing the computational complexity of object recognition and facilitating large-scale deployment.

[0044] Embodiment three:

[0045] The embodiment of the present invention also provides another object recognition method, which is implemented on the basis of the method in the above embodiment; the method focuses on describing the specific implementation process of deforming and filling the first image if the visible part of the target object in the first image does not include all the parts of the target object, so that the relative position of the visible part of the target object included in the first image in the first image meets the specified standard, such as Figure 3 As shown, the method comprises the following steps:

[0046] Step S302: Acquire a first image containing a target object.

[0047] Step S304: input the first image into a pre-trained first neural network model, identify the visible part of the target object in the first image through the first neural network model, and determine the visible area ratio and fill boundary marker of the first image based on the visible part; wherein the fill boundary marker is used to indicate the position of the invisible part of the target object in the first image.

[0048] The above-mentioned first neural network model can also be called a visibility prediction model. The model can be implemented by a variety of convolutional neural networks, such as residual networks, VGG networks, etc. The first neural network model can be a convolutional neural network model of any size, for example, it can be resnet34_05x, etc.; usually the first neural network model is a lightweight convolutional neural network model. The lightweight convolutional neural network model can ensure the accuracy of the neural network model on the basis of reducing the consumption of computing resources, and improve the efficiency of the neural network model to a certain extent.

[0049] The above-mentioned visible area ratio can be understood as the ratio of the image area corresponding to the visible part of the target object in the first image when the first image contains all the parts of the target object; in actual implementation, after obtaining the first image containing the target object, the visible part of the target object in the first image is usually first identified, for example, taking the first image as a half-body image of a pedestrian as an example, by identifying the pedestrian in the first image, it can be determined that the visible part of the pedestrian includes the head and upper body of the pedestrian. The identification process usually also includes positioning processing of the visible parts. Through positioning processing, the position of the head and the upper body of the target object in the first image can be determined; if The first image is a full-body image of the pedestrian, and the areas corresponding to the head and upper torso account for 70% of the full-body image, so the visible area of ​​the half-body image including only the head and upper torso of the pedestrian accounts for 70%; the above-mentioned filling boundary mark can indicate the position of the invisible part in the target object, and the position of the invisible part of the target object indicated by the filling boundary mark is different according to the different visible parts of the target object in the first image. For example, still taking the first image as a half-body image of the pedestrian, and the visible parts including the head and upper torso of the pedestrian, the invisible part of the pedestrian is the lower torso of the pedestrian, and the position of the invisible part of the pedestrian indicated by the corresponding filling boundary mark may be below the boundary of the first image.

[0050] In actual implementation, the first neural network model may include but is not limited to the following two training methods. The first training method is first introduced below, and can be specifically implemented through the following steps 1 to 4.

[0051] Step 1: Acquire a first sample image including all parts of a first object.

[0052] The first object may be a person, an animal or any other object; the first sample image may be a photo, a picture or a video image containing the first object. For the convenience of explanation, the first object is a pedestrian as an example. In this method, in order to train the first neural network model, the first sample image containing all parts of the pedestrian is first obtained, that is, the first sample image is a full-body image of the pedestrian.

[0053] Step 2: cropping a designated area of ​​the first sample image that includes at least a portion of the first object to obtain a second sample image, as well as a cropping ratio and a reference filling boundary mark of the second sample image.

[0054] The above-mentioned at least part of the part can be any part of the pedestrian in the first sample image, for example, it can be the lower body of the pedestrian, etc. In actual implementation, after obtaining the above-mentioned first sample image, it is usually necessary to randomly crop the first sample image to obtain a cropped second sample image and a corresponding cropping ratio and a reference filling boundary mark; for example, after cropping the first sample image, a second sample image including the head and upper body of the pedestrian is obtained, and the corresponding cropping ratio is 30%, and the reference filling boundary mark is below the boundary of the second sample image.

[0055] Step three, input the second sample image into the initial first neural network model to output the initial visible area ratio and initial filling boundary mark of the second sample image through the initial first neural network model.

[0056] In actual implementation, after obtaining the second sample image, the second sample image is usually adjusted to a preset size, and then the resized second sample image is input into the initial first neural network model to output the initial visible area ratio and initial fill boundary marker of the second sample image through the initial first neural network model.

[0057] Step 4: determine a first loss value based on the initial visible area ratio, the initial fill boundary mark, the cropping ratio, and the reference fill boundary mark, and update the weight parameters of the initial first neural network model based on the first loss value; continue to execute the step of obtaining a first sample image containing all parts of the first object until the initial first neural network model converges to obtain the first neural network model.

[0058] In this method, the training process of the first neural network model can be supervised by the cropping ratio and reference filling boundary marker obtained during the random cropping process, and a first loss value is determined based on the initial visible area ratio, the initial filling boundary marker, the cropping ratio and the reference filling boundary marker, and the weight parameters of the initial first neural network model are updated based on the first loss value; the step of obtaining a first sample image containing all parts of the pedestrian is continued until the initial first neural network model converges to obtain the first neural network model.

[0059] In the first training method for the first neural network model mentioned above, the first neural network model is trained by self-learning. Before inputting the initial first neural network model, the image area corresponding to the lower body of the pedestrian can be randomly cropped for each image, and the cropped image can be adjusted to a uniform size. At the same time, the cropping ratio and the reference filling boundary mark are recorded. The cropping ratio can be represented by r, and the cropping ratio r and the reference filling boundary mark are used as the GT (Ground Truth, indicating the classification accuracy of the supervised learning training set, used to prove or disprove a hypothesis) of the initial first neural network model. The trained first neural network model can predict the visible area ratio and the filling boundary mark of the first image.

[0060] The second training method of the first neural network model is introduced below, which can be implemented through the following steps five to seven.

[0061] Step 5: Obtain a third sample image containing the second object, and all part detection frames and visible part detection frames corresponding to the second object.

[0062] The second object may be a person, an animal or any other object; the third sample image may be a photo, a picture or a video image containing the second object. For the convenience of explanation, the second object is a pedestrian. In this method, in order to train the first neural network model, the third sample image containing the pedestrian is first obtained, and the entire part detection frame corresponding to the entire part of the pedestrian contained in the third sample image, and the visible part detection frame containing only the visible part of the pedestrian are obtained. The third sample image may be a panoramic image.

[0063] Step six, input the third sample image into the initial first neural network model to output the first detection frame including all parts corresponding to the second object and the second detection frame including the visible parts through the initial first neural network model, and determine the initial visible area ratio and the initial filling boundary marker of the second object based on the first detection frame and the second detection frame.

[0064] In actual implementation, after obtaining the above-mentioned third sample image, the third sample image is input into the initial first neural network model, and the initial first neural network model outputs the first detection frame corresponding to the pedestrian including all parts, and the second detection frame including the visible parts, wherein the first detection frame can also be called the initial full body frame, and the second detection frame can also be called the initial visible frame, etc. Based on the ratio and relative position between the second detection frame and the first detection frame, the initial visible area ratio and the initial filling boundary marker of the pedestrian in the third sample image are determined.

[0065] Step seven, based on the initial visible area ratio, the initial filling boundary mark, the detection frame of all parts and the visible part detection frame, determine the second loss value, and update the weight parameters of the initial first neural network model based on the second loss value; continue to execute the step of obtaining the third sample image containing the second object until the initial first neural network model converges to obtain the first neural network model.

[0066] In this method, the training process of the first neural network model can be supervised by the detection frame of all parts of the pedestrian, and the corresponding visible part detection frame or pedestrian segmentation results, and the second loss value is determined in combination with the initial visible area ratio and the initial filling boundary mark, and the weight parameters of the initial first neural network model are updated based on the second loss value; the step of obtaining the third sample image containing the pedestrian is continued until the initial first neural network model converges to obtain the first neural network model. The trained first neural network model can predict the visible area ratio and the filling boundary mark of the first image.

[0067] The above-mentioned second training method for the first neural network model can integrate the first neural network model into the pedestrian detection model, wherein the pedestrian detection model can adopt the model structure in the prior art. Through the pedestrian detection model, while predicting the full body frame of the pedestrian, the visible frame of the pedestrian can be predicted, and then according to the ratio of the visible frame to the full body frame, the visible area ratio and the filling boundary mark of the third sample image can be calculated.

[0068] Step S306: If the visible area ratio is less than 1, it is determined that the visible part of the target object in the first image does not include all parts of the target object. Based on the visible area ratio and the fill boundary marker, the first image is deformed and filled so that the relative position of the visible part of the target object contained in the first image meets the specified standard.

[0069] In actual implementation, the visible area ratio of the first image determined by the first neural network model may be less than 1 or equal to 1. If the visible area ratio is equal to 1, it can be understood that the visible part of the target object in the first image includes all parts of the target object, and no filling is required, or the area of ​​the filling area is 0. If the visible area ratio is less than 1, it can be understood that the visible part of the target object in the first image does not include all parts of the target object; for example, taking the target object as a pedestrian, if the visible area ratio is equal to 1, it means that the first image is a full-body image of the pedestrian. If the visible area ratio is less than 1, it means that the first image is a half-body image of the pedestrian, and the half-body image may only include the head of the pedestrian, or only include the head and upper body of the pedestrian, etc.

[0070] If it is determined that the visible part of the target object in the first image does not include all parts of the target object, step S306 may implement deformation and filling processing of the first image through the following steps eight and nine:

[0071] Step eight: based on the visible area ratio, adjust the size of the first image so that the relative position of the visible part of the target object contained in the first image in the first image meets a specified standard.

[0072] In actual implementation, if the visible area ratio is less than 1, the size of the first image can be adjusted according to the visible area ratio. For example, taking the target object as a pedestrian, the visible parts of the pedestrian in the first image include the head and the upper body, the visible area ratio is 0.7, and the size of the first image is 256*128 pixels. Since what is missing is the lower body of the pedestrian, the size of the first image in the length direction can be adjusted according to the visible area ratio. The size of the length direction of the adjusted first image is 256*0.7=179.2, and the size in the width direction remains unchanged, that is, the size of the adjusted first image is 179.2*128. The relative position of the visible parts of the pedestrian contained in the adjusted first image in the first image meets the above-mentioned specified standard, which includes: when all parts of the pedestrian are contained in the first image, the relative position of the above-mentioned visible parts, namely the head and the upper body, in the first image.

[0073] Step nine: Based on the filling boundary mark, fill the area corresponding to the invisible part of the first image after the size adjustment to restore the size of the first image to the size before the size adjustment.

[0074] The above-mentioned invisible parts can be understood as other parts of the target object in the first image except the visible parts. For example, taking the target object as a pedestrian, and the visible parts of the pedestrian in the first image include the head and the upper body as an example, then the invisible parts are all the body parts of the pedestrian except the head and the upper body. In actual implementation, since the filling boundary marker can indicate the position of the invisible parts of the target object in the first image, the area corresponding to the invisible parts of the first image after resizing can be filled based on the filling boundary marker. For example, still taking the target object as a pedestrian, and the visible parts of the pedestrian in the first image include the head and the upper body, and the visible area accounts for 0.7, and the size of the first image is 256*128 pixels as an example, then the invisible parts of the pedestrian in the first image include the lower body, and the filling boundary marker of the first image The position of the invisible part of the pedestrian indicated by the mark is below the boundary of the first image. Since the visible area accounts for 0.7, the area corresponding to the invisible part accounts for 1-0.7=0.3. The size of the area corresponding to the corresponding invisible part in the length direction is 256*0.3=76.8, and the size in the width direction remains unchanged. The size of the area corresponding to the invisible part is 76.8*128; therefore, the area corresponding to the invisible part can be filled below the boundary of the resized first image. After the filling process is completed, the size of the filled first image in the length direction is 179.2+76.8=256, and the size in the width direction remains unchanged. Therefore, the size of the filled first image is the same as the size of the first image before the resizing, that is, the size of the filled first image is restored to 256*128.

[0075] The step S306 can also implement deformation and filling processing of the first image through the following steps 10 and 11:

[0076] Step ten: filling the area corresponding to the invisible part of the first image based on the visible area ratio and the filling boundary mark.

[0077] In actual implementation, based on the visible area ratio and the filling boundary mark determined in the above steps, the area corresponding to the invisible part of the first image can be filled first. For example, still taking the target object as a pedestrian, the visible parts of the pedestrian in the first image include the head and the upper body, the visible area ratio is 0.7, and the size of the first image is 256*128 pixels. Then, the invisible part of the pedestrian in the first image includes the lower body, and the position of the invisible part of the pedestrian indicated by the filling boundary mark of the first image is below the boundary of the first image. Since the visible area ratio is 0.7, the invisible part The corresponding area accounts for 1-0.7=0.3, and the size of the area corresponding to the corresponding invisible part in the length direction is 256 / 0.7*0.3=109.7, and the size in the width direction remains unchanged. The size of the area corresponding to the invisible part is 109.7*128. Below the boundary of the first image, the area corresponding to the invisible part is filled. After the filling process is completed, the size of the first image after filling in the length direction is 256+109.7=365.7, and the size in the width direction remains unchanged, that is, the size of the first image after filling is 365.7*128.

[0078] Step eleven, adjusting the size of the first image after the filling process to restore the size of the first image after the filling process to the size before the filling process, and the relative position of the visible part of the target object contained in the adjusted first image in the adjusted first image meets the specified standard.

[0079] In actual implementation, the size of the first image after filling processing can be adjusted based on the above-mentioned visible area ratio. Continuing with the example in the above-mentioned step ten, since the visible area ratio is 0.7, the size of the first image after filling processing is 365.7*128, and the filling processing is performed below the boundary of the first image, therefore, based on the visible area ratio, the size of the first image in the length direction after filling processing is adjusted, and the size of the first image in the length direction after adjustment is 365.7*0.7=256, and the size in the width direction remains unchanged, which is still 128, that is, through this adjustment processing, the size of the first image after filling processing is made the same as the size of the first image before filling processing, which is still 256*128, and the relative position of the visible part of the pedestrian contained in the first image after the size adjustment in the adjusted first image meets the specified standard, and the specified standard includes: when all parts of the pedestrian are contained in the first image, the relative position of the above-mentioned visible parts, namely the head and the upper body, in the first image.

[0080] Step S308: extracting object features of the target object from the processed first image, and identifying the target object based on the object features.

[0081] The object recognition method provided by the embodiment of the present invention first obtains a first image containing a target object; inputs the first image into a pre-trained first neural network model, identifies the visible part of the target object in the first image through the first neural network model, and determines the visible area ratio and filling boundary mark of the first image based on the visible part; if the visible area ratio is less than 1, it is determined that the visible part of the target object in the first image does not contain all the parts of the target object, and based on the visible area ratio and the filling boundary mark, the first image is deformed and filled so that the relative position of the visible part of the target object contained in the first image in the first image meets the specified standard; finally, the object feature of the target object is extracted from the processed first image, and the target object is identified based on the object feature. In this method, when the part of the target object in the image is incomplete, the image is deformed and filled so that the relative position of each part of the target object in the image matches the relative position when the image contains the complete part of the target object, and the object feature of the target object is directly extracted from the processed image to identify the target object, without the need for local segmentation and identification of each part, thereby reducing the computational complexity of object recognition and facilitating large-scale deployment.

[0082] Embodiment 4:

[0083] The embodiment of the present invention also provides another object recognition method, which is implemented on the basis of the method in the above embodiment; the method focuses on the specific implementation process of extracting the object features of the target object from the processed first image and recognizing the target object based on the object features, such as Figure 4 As shown, the method comprises the following steps:

[0084] Step S402: Acquire a first image containing a target object.

[0085] Step S404, if the visible part of the target object in the first image does not include all the parts of the target object, deform and fill the first image so that the relative position of the visible part of the target object included in the first image meets the specified standard; the specified standard includes: when the first image includes all the parts of the target object, the relative position of the visible part in the first image.

[0086] Step S406: extracting object features of the target object from the processed first image through a second neural network model; wherein the object features include features of visible parts of the target object.

[0087] The above-mentioned second neural network model can also be called a pedestrian re-identification model, which can be implemented by a variety of convolutional neural networks, such as residual networks, VGG networks, etc. The training method of the second neural network model is introduced below, which can be specifically implemented by the following steps 15 to 19.

[0088] Step fifteen: obtaining a fourth sample image including all parts of the third object and target features of the third object.

[0089] The third object may be a person, an animal or any other object; the fourth sample image may be a photo, a picture or a video image containing the third object. For the convenience of explanation, the third object is a pedestrian. Figure 5 A schematic diagram of an image preprocessing process is shown in FIG. Figure 5 As shown, in this method, in order to train the second neural network model, first obtain the original training data containing all parts of the pedestrian, that is, the original training data is the full-body image of the pedestrian, corresponding to the fourth sample image. The target feature can be the gender feature, age feature, clothing color feature or appearance feature of the pedestrian.

[0090] Step 16: crop a designated area in the fourth sample image that includes at least a portion of the third object to obtain a fifth sample image.

[0091] The above-mentioned at least part of the part can be any part of the pedestrian in the fourth sample image, for example, it can be the lower body of the pedestrian, etc. In actual implementation, after obtaining the above-mentioned fourth sample image, that is, after obtaining the original training data, the lower body of the original training data can be randomly cropped to obtain a partial image, and the partial image is the half-body image of the pedestrian, corresponding to the above-mentioned fifth sample image.

[0092] Step seventeen, performing filling processing on the fifth sample image to obtain a sixth sample image; wherein the relative position of the designated part of the third object in the sixth sample image matches the relative position of the designated part of the third object in the fourth sample image.

[0093] In actual implementation, when the fifth sample image, that is, the partial image, is obtained, the partial image can be filled with a value v to obtain pad, wherein the filling value v can be selected as 0, the lower boundary value (replica), 128, (103.939, 116.779, 123.68), etc. The size is usually restored to the size before filling. The relative position of the visible part of the pedestrian in the partial image after filling is the same as the relative position of the corresponding visible part in the original training data, that is, the visible part in the partial image after filling is aligned with the visible part of the full body image of the original training data, such as the head, shoulders and other body parts, and the sizes of each visible part can also be the same. After alignment, the data input distribution of the model is more uniform, which can reduce the input noise level. For example, for the network, the half-body image usually always includes the head and shoulders of the pedestrian, etc. The network can use this spatial pattern to learn the recognition ability of the corresponding position. The partial image after filling corresponds to the sixth sample image.

[0094] The filled partial image is usually deformed to adjust its size to a specified size. The specified size is constrained by computing power and is not fixed. Generally, the size of an image containing a human body can be 256x128 or 384x192, etc.

[0095] Step eighteen, inputting the sixth sample image into the initial second neural network model to output the initial features of the third object in the sixth sample image through the initial second neural network model.

[0096] In actual implementation, after completing the above-mentioned deformation and filling processing on the training data original, it can be input into the initial second neural network model, and the initial features of the processed training data original are output through the initial second neural network model. During the training process, no supervision information is required, or there may be supervision information. If there is supervision information, the corresponding supervision information can be the target features of pedestrians in the image.

[0097] Step nineteen, determining a third loss value based on the initial features and the target features, and updating the weight parameters of the initial second neural network model based on the third loss value; continuing to execute the step of obtaining a fourth sample image containing all parts of the third object until the initial second neural network model converges to obtain a second neural network model.

[0098] In actual implementation, after obtaining the initial features of the pedestrian in the processed training data original, a third loss value can be determined based on the initial features and the target features, and the third loss value can be used to indicate the gap between the initial features and the target features; the weight parameters of the initial second neural network model can be updated based on the third loss value; and the step of obtaining a fourth sample image containing all parts of the third object and the target features of the third object is continued until the initial second neural network model converges. During the training process, multiple training data originals are required, and multiple training data originals can be obtained from a preset data set. Each training data original needs to undergo the above-mentioned deformation and filling processing process, that is, the second neural network model is obtained by adopting the "pad augmentation" pre-training method.

[0099] In actual implementation, the processed first image can be input into a trained second neural network model, and the object features of the target object are output through the second neural network model. The extracted object features usually include features of visible parts of the target object.

[0100] Step S408 , calculating a feature distance between an object feature of the target object and an object feature of a specified object in a preset reference image, and determining whether the target object and the specified object are the same object.

[0101] The above-mentioned specified object can be understood as the object that is desired to be identified when performing object recognition; the above-mentioned preset reference image can be a pre-acquired image containing the specified object, and the object features of the specified object are usually pre-acquired; in actual implementation, the object features of the target object can be extracted from the processed first image, the feature distance between the object features of the target object and the object features of the specified object can be detected, and the similarity between the target object and the specified object can be judged based on the feature distance, and then it can be confirmed whether the target object and the specified object are the same object. For example, when the feature distance is less than or equal to a preset threshold, it is judged that the target object and the specified object are the same object; when the feature distance is greater than the preset threshold, it is judged that the target object and the specified object are not the same object.

[0102] If the visible part of the specified object in the reference image includes all parts of the specified object, the object features of the specified object can be extracted based on the prior art. If the visible part of the specified object in the reference image does not include all parts of the specified object, the object features of the specified object in the reference image can be determined by the following steps 20 and 21:

[0103] Step 20: If the visible part of the specified object in the reference image does not include all the parts of the specified object, the reference image is deformed and filled so that the relative position of the visible part of the specified object included in the reference image meets the preset standard; the preset standard includes: when the reference image includes all the parts of the specified object, the relative position of the visible part in the reference image.

[0104] The visible part of the specified object in the above-mentioned reference image may include all parts of the specified object, or may not include all parts of the specified object. If the visible part of the specified object in the reference image does not include all parts of the specified object, considering that when the reference image includes all parts of the specified object, the relative positions of the corresponding visible parts in the reference image are usually different, therefore, the reference image can be deformed and filled so that the relative positions of the visible parts of the specified object contained in the processed reference image in the reference image match the relative positions of the corresponding visible parts in the first image when the reference image includes all parts of the specified object; for example, if the reference image is a half-body image including the head and upper body of a pedestrian, the half-body image can be compressed and filled, and the relative positions of the head and upper body of the pedestrian in the processed half-body image in the reference image are the same or aligned with the relative positions of the head and upper body of the pedestrian in the reference image when the reference image includes all body parts of the pedestrian, and the corresponding sizes of the head and upper body can also usually be the same.

[0105] Step 21: extract object features of the specified object from the processed reference image.

[0106] After the acquired reference image is deformed and filled, object features corresponding to the designated object can be extracted from the processed reference image.

[0107] The object recognition method provided by the embodiment of the present invention first obtains a first image containing a target object; if the visible part of the target object in the first image does not contain all the parts of the target object, the first image is deformed and filled so that the relative position of the visible part of the target object contained in the first image in the first image meets the specified standard; the object features of the target object are extracted from the processed first image through a second neural network model. The feature distance between the object features of the target object and the object features of the specified object in the preset reference image is calculated to determine whether the target object and the specified object are the same object. In this method, when the part of the target object in the image is incomplete, the image is deformed and filled so that the relative position of each part of the target object in the image matches the relative position when the image contains the complete part of the target object. The object features of the target object are directly extracted from the processed image to identify the target object without the need for local segmentation and recognition of each part, thereby reducing the computational complexity of object recognition and facilitating large-scale deployment.

[0108] To further understand the above embodiment, the object recognition method is further explained below by taking the first image as an example of a pedestrian image. In actual use, a visibility prediction model (corresponding to the above first neural network model) can be trained in a self-learning manner to perceive the visible parts of the pedestrian in the pedestrian image; then, when training and testing the pedestrian re-identification model (corresponding to the above second neural network model), the pedestrian image is preprocessed, and the corresponding invisible parts are filled with a uniform value according to the visible parts predicted by the visibility prediction model to ensure that the aspect ratio of the pedestrian image remains unchanged, and the visible parts are aligned with the corresponding visible parts when all parts of the pedestrian are included in the pedestrian image. It should be noted that, considering that the image size required by the visibility prediction model may be smaller than the image size required by the pedestrian re-identification model, in order to ensure that the amount of information in the image is not reduced, the training process of the above visibility prediction model and the pedestrian re-identification model is usually carried out in parallel using a parallel structure, and generally not in serial using a serial structure.

[0109] The pedestrian re-identification model trained by this method can map the half-body image and the full-body image to the same feature subspace, and then compare the similarity of the half-body image and the full-body image in the feature subspace. During use, only one feature needs to be extracted for each image. Regardless of whether the image is a half-body image or a full-body image, this single global feature is used for matching, and the similarity between images is calculated, so that matching with the full-body image and the half-body image can be completed at the same time, without extracting local features one by one. Since only one feature needs to be extracted for each image, the complexity of the model is reduced, and the distance between samples is still calculated once between each two, so the distance calculation complexity is minimized, which reduces the complexity of the distance calculation between samples and facilitates large-scale deployment.

[0110] In the related art, the features of the half-body image tend to form a relatively independent feature subspace, which results in the half-body images being very close to each other, but the half-body image and the corresponding full-body image being very different. This solution adjusts the overall distribution of the half-body image to be consistent with the full-body image. Each pedestrian in the image can have an identity ID corresponding to the pedestrian, and each ID can have multiple images. The half-body image of each ID can be returned to the feature subspace belonging to its own ID, thereby improving the recall of the half-body images of the same ID and reducing the misidentification of pedestrians in the half-body images of different IDs. In addition, this method can adopt a self-learning training scheme, which does not require additional annotation information, such as human body parts annotation, human body posture annotation, or human body visible parts annotation, thereby further simplifying the object recognition process.

[0111] Embodiment five:

[0112] Corresponding to the above method embodiment, see Figure 6 A structural schematic diagram of an object recognition device is shown, the device comprising: an acquisition module 60, used to acquire a first image containing a target object; a processing module 61, used to deform and fill the first image if the visible part of the target object in the first image does not contain all the parts of the target object, so that the relative position of the visible part of the target object contained in the first image in the first image meets a specified standard; the specified standard includes: when the first image contains all the parts of the target object, the relative position of the visible part in the first image; an identification module 62, used to extract object features of the target object from the processed first image, and identify the target object based on the object features.

[0113] The object recognition device provided by the embodiment of the present invention first obtains a first image containing a target object; if the visible part of the target object in the first image does not contain all the parts of the target object, the first image is deformed and filled so that the relative position of the visible part of the target object contained in the first image in the first image meets a specified standard; the specified standard includes: when the first image contains all the parts of the target object, the relative position of the visible part in the first image; finally, the object features of the target object are extracted from the processed first image, and the target object is recognized based on the object features. In the device, when the part of the target object in the image is incomplete, the image is deformed and filled so that the relative position of each part of the target object in the image matches the relative position when the image contains the complete part of the target object, and the object features of the target object are directly extracted from the processed image to recognize the target object, without the need for local segmentation and recognition of each part, thereby reducing the computational complexity of object recognition and facilitating large-scale deployment.

[0114] Furthermore, the processing module 61 is also used to: input the first image into a pre-trained first neural network model, identify the visible part of the target object in the first image through the first neural network model, and determine the visible area ratio and fill boundary marker of the first image based on the visible part; wherein the fill boundary marker is used to: indicate the position of the invisible part of the target object in the first image; if the visible area ratio is less than 1, it is determined that the visible part of the target object in the first image does not include all parts of the target object, and based on the visible area ratio and the fill boundary marker, the first image is deformed and filled so that the relative position of the visible part of the target object contained in the first image in the first image meets the specified standard.

[0115] Furthermore, the processing module 61 is also used to: adjust the size of the first image based on the visible area ratio so that the relative position of the visible part of the target object contained in the first image in the first image meets the specified standard; based on the filling boundary marker, fill the area corresponding to the invisible part of the first image after the size adjustment to restore the size of the first image to the size before the size adjustment.

[0116] Furthermore, the processing module 61 is also used to: fill the area corresponding to the invisible part of the first image based on the visible area ratio and the filling boundary marker; adjust the size of the first image after the filling process to restore the size of the first image after the filling process to the size before the filling process, and the relative position of the visible part of the target object contained in the adjusted first image in the adjusted first image meets the specified standard.

[0117] Furthermore, the recognition module 62 is also used to: extract object features of the target object from the processed first image through a second neural network model; wherein the object features include features of visible parts of the target object; calculate the feature distance between the object features of the target object and the object features of a specified object in a preset reference image, and determine whether the target object and the specified object are the same object.

[0118] Furthermore, the device also includes a first determination module, a pre-trained first neural network model is determined by the first determination module, and the first determination module is used to: obtain a first sample image including all parts of the first object; crop a specified area in the first sample image including at least a part of the first object to obtain a second sample image, as well as a cropping ratio and a reference fill boundary mark of the second sample image; input the second sample image into the initial first neural network model to output an initial visible area ratio and an initial fill boundary mark of the second sample image through the initial first neural network model; determine a first loss value based on the initial visible area ratio, the initial fill boundary mark, the cropping ratio, and the reference fill boundary mark, and update the weight parameters of the initial first neural network model based on the first loss value; continue to execute the step of obtaining the first sample image including all parts of the first object until the initial first neural network model converges to obtain the first neural network model.

[0119] Furthermore, the device also includes a second determination module, and the pre-trained first neural network model is determined by the second determination module, and the second determination module is used to: obtain a third sample image containing the second object, and a detection frame of all parts and a visible part detection frame corresponding to the second object; input the third sample image into the initial first neural network model to output a first detection frame containing all parts and a second detection frame containing visible parts corresponding to the second object through the initial first neural network model, and determine the initial visible area ratio and initial filling boundary mark of the second object based on the first detection frame and the second detection frame; determine the second loss value based on the initial visible area ratio, the initial filling boundary mark, the detection frame of all parts and the detection frame of visible parts, and update the weight parameters of the initial first neural network model based on the second loss value; continue to execute the step of obtaining the third sample image containing the second object until the initial first neural network model converges to obtain the first neural network model.

[0120] Furthermore, the device also includes a third determination module and a second neural network model, which is determined by the third determination module and is used to: obtain a fourth sample image including all parts of the third object and target features of the third object; crop a designated area in the fourth sample image including at least a part of the third object to obtain a fifth sample image; fill the fifth sample image to obtain a sixth sample image; wherein the relative position of the designated part of the third object in the sixth sample image matches the relative position of the designated part of the third object in the fourth sample image; input the sixth sample image into the initial second neural network model to output the initial features of the third object in the sixth sample image through the initial second neural network model; determine a third loss value based on the initial features and the target features, and update the weight parameters of the initial second neural network model based on the third loss value; continue to execute the step of obtaining the fourth sample image including all parts of the third object until the initial second neural network model converges to obtain the second neural network model.

[0121] The object recognition device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned object recognition method embodiment. For the sake of brief description, for matters not mentioned in the object recognition device embodiment, reference may be made to the corresponding contents in the aforementioned object recognition method embodiment.

[0122] Embodiment six:

[0123] An embodiment of the present invention also provides an electronic system, which includes: an image acquisition device, a processing device and a storage device; the image acquisition device is used to obtain preview video frames or image data; a computer program is stored on the storage device, and the computer program executes the steps of the above-mentioned object recognition method when the processed device is running.

[0124] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the electronic system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0125] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processing device, the steps of the object recognition method described above are executed.

[0126] The computer program products of the object recognition method, device and electronic system provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments and will not be repeated here.

[0127] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and / or device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0128] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0129] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0130] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0131] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An object recognition method, characterized in that: The method comprises: Acquire a first image containing a target object; If the visible part of the target object in the first image does not include all parts of the target object, deforming and filling the first image so that the relative position of the visible part of the target object included in the first image in the first image meets a specified standard; the specified standard includes: when the first image includes all parts of the target object, the relative position of the visible part in the first image; The object features of the target object are extracted from the processed first image, and the target object is identified based on the object features.

2. The method according to claim 1, characterized in that If the visible part of the target object in the first image does not include all parts of the target object, the step of deforming and filling the first image so that the relative position of the visible part of the target object included in the first image meets a specified standard includes: Inputting the first image into a pre-trained first neural network model, identifying the visible part of the target object in the first image through the first neural network model, and determining the visible area ratio and fill boundary mark of the first image based on the visible part; wherein the fill boundary mark is used to indicate the position of the invisible part of the target object in the first image; If the visible area ratio is less than 1, it is determined that the visible part of the target object in the first image does not include all parts of the target object, and based on the visible area ratio and the fill boundary marker, the first image is deformed and filled so that the relative position of the visible part of the target object contained in the first image meets the specified standard.

3. The method according to claim 2, characterized in that The step of deforming and filling the first image based on the visible area ratio and the filling boundary mark so that the relative position of the visible part of the target object contained in the first image in the first image meets the specified standard includes: Based on the visible area ratio, adjusting the size of the first image so that the relative position of the visible part of the target object contained in the first image in the first image meets a specified standard; Based on the filling boundary mark, a filling process is performed on the area corresponding to the invisible portion of the first image after the size adjustment, so as to restore the size of the first image to the size before the size adjustment.

4. The method according to claim 2, characterized in that: The step of deforming and filling the first image based on the visible area ratio and the filling boundary mark so that the relative position of the visible part of the target object contained in the first image meets the specified standard includes: Based on the visible area ratio and the filling boundary mark, filling processing is performed on the area corresponding to the invisible part of the first image; The size of the first image after the filling process is adjusted to restore the size of the first image after the filling process to the size before the filling process, and the relative position of the visible part of the target object contained in the adjusted first image in the adjusted first image meets the specified standard.

5. The method according to claim 1, characterized in that The step of extracting object features of the target object from the processed first image and identifying the target object based on the object features comprises: Extracting object features of the target object from the processed first image through a second neural network model; wherein the object features include features of a visible part of the target object; The feature distance between the object feature of the target object and the object feature of the specified object in the preset reference image is calculated to determine whether the target object and the specified object are the same object.

6. The method according to claim 2, characterized in that The pre-trained first neural network model is determined in the following manner: Acquire a first sample image including all parts of the first object; cropping a designated area of ​​the first sample image that includes at least a portion of the first object to obtain a second sample image, as well as a cropping ratio and a reference filling boundary mark of the second sample image; Inputting the second sample image into the initial first neural network model, so as to output an initial visible area ratio and an initial filling boundary mark of the second sample image through the initial first neural network model; A first loss value is determined based on the initial visible area ratio, the initial fill boundary marker, the cropping ratio, and the reference fill boundary marker, and a weight parameter of the initial first neural network model is updated based on the first loss value; and the step of obtaining a first sample image including all parts of the first object is continued until the initial first neural network model converges to obtain the first neural network model.

7. The method according to claim 2, characterized in that The pre-trained first neural network model is determined in the following manner: Acquire a third sample image including a second object, and all part detection frames and visible part detection frames corresponding to the second object; Inputting the third sample image into the initial first neural network model, so as to output a first detection frame including all parts and a second detection frame including visible parts corresponding to the second object through the initial first neural network model, and determining an initial visible area ratio and an initial filling boundary mark of the second object based on the first detection frame and the second detection frame; Based on the initial visible area ratio, the initial filling boundary mark, the all-part detection frame and the visible part detection frame, a second loss value is determined, and the weight parameters of the initial first neural network model are updated based on the second loss value; the step of obtaining a third sample image containing a second object is continued until the initial first neural network model converges to obtain the first neural network model.

8. The method according to claim 5, characterized in that The second neural network model is determined in the following manner: Acquire a fourth sample image including all parts of the third object and target features of the third object; cutting out a designated area of ​​the fourth sample image that includes at least a portion of the third object to obtain a fifth sample image; Filling the fifth sample image to obtain a sixth sample image; wherein the relative position of the designated part of the third object in the sixth sample image matches the relative position of the designated part of the third object in the fourth sample image; Inputting the sixth sample image into the initial second neural network model, so as to output the initial features of the third object in the sixth sample image through the initial second neural network model; Determine a third loss value based on the initial features and the target features, and update the weight parameters of the initial second neural network model based on the third loss value; continue to execute the step of obtaining a fourth sample image containing all parts of the third object until the initial second neural network model converges to obtain the second neural network model.

9. An object recognition device, characterized in that: The device comprises: An acquisition module, used for acquiring a first image containing a target object; a processing module, configured to, if the visible part of the target object in the first image does not include all parts of the target object, perform deformation and filling processing on the first image so that the relative position of the visible part of the target object included in the first image in the first image satisfies a specified standard; the specified standard includes: the relative position of the visible part in the first image when all parts of the target object are included in the first image; The recognition module is used to extract the object features of the target object from the processed first image, and recognize the target object based on the object features.

10. An electronic system, characterized in that: The electronic system includes: an image acquisition device, a processing device and a storage device; The image acquisition device is used to obtain preview video frames or image data; The storage device stores a computer program, which, when executed by the processing device, executes the object recognition method according to any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the object recognition method according to any one of claims 1 to 8 are executed.