Object identification method, device, storage medium and processor
Through the region generation and perception model in the target network model, the sub-region positions are adaptively predicted and weighted, which solves the problem of low efficiency of object re-identification and achieves efficient and accurate re-identification.
Patent Information
- Application Number
- CN202011181679.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-29
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2040-10-29
AI Technical Summary
In existing technologies, object re-identification is inefficient, cannot handle severe misalignment between images, and cannot eliminate background or occlusion effects.
The target network model, including the region generation model and the region perception model, is adopted to adaptively predict the location information of sub-regions and assign different weights to avoid the influence of meaningless sub-regions and achieve efficient re-identification.
The efficiency of object re-identification is improved, the amount of calculation is reduced, the generation of occluded areas is avoided, and the accuracy and efficiency of recognition are enhanced.
Smart Images

Figure CN114511814B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to an object recognition method, device, storage medium and processor. Background Art
[0002] Currently, when re-identifying an object, the image can be directly divided into fixed horizontal stripes to obtain richer, fine-grained local features. However, fixed horizontal stripes cannot handle severe misalignment between images and cannot eliminate the effects of background or occlusion, resulting in low efficiency in object re-identification.
[0003] Currently, no effective solution has been proposed to the above-mentioned technical problem of low efficiency in object re-identification. Summary of the Invention
[0004] Embodiments of the present invention provide an object recognition method, device, storage medium, and processor to at least solve the technical problem of low efficiency in re-recognition of an object.
[0005] According to one aspect of an embodiment of the present invention, a method for identifying an object is provided. The method may include: obtaining a target image including an object to be identified; identifying the target image using a target network model to obtain target position information of a target region corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is used to determine position information of subregions corresponding to multiple subimages in the target image, the subimage including at least one sub-object of the object, and the region perception model is used to determine a target weight of the subregion, the target weight being used to represent the importance of the subregion to the target region; and re-identifying the object in the target image based on the target position information to obtain a re-identification result.
[0006] According to another aspect of an embodiment of the present invention, another object recognition method is provided. The method may include: obtaining a target image including a pedestrian to be recognized; recognizing the target image using a target network model to obtain target position information of a target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is used to determine position information of sub-areas corresponding to multiple sub-images in the target image, the sub-image including at least one sub-part of the pedestrian, and the region perception model is used to determine a target weight of the sub-area, the target weight being used to represent the importance of the sub-area to the target area; and re-recognizing the pedestrian in the target image based on the target position information to obtain a re-recognition result.
[0007] According to another aspect of an embodiment of the present invention, another object recognition method is provided. The method may include: displaying a target image including an object to be recognized on a target interface; and displaying a re-recognition result on the target interface, wherein the re-recognition result is obtained by re-recognizing the object in the target image based on target position information of a target area, the target position information is obtained by recognizing the target image through a target network model, the target network model includes a region generation model and a region perception model, the region generation model is used to determine position information of sub-regions corresponding to multiple sub-images in the target image, the sub-image includes at least one sub-object of the object, and the region perception model is used to determine a target weight of the sub-region, and the target weight is used to represent the importance of the sub-region to the target area.
[0008] According to another aspect of an embodiment of the present invention, another object recognition method is provided. The method may include: a front-end client uploading a target image including an object to be recognized to a back-end server; and the front-end client receiving a re-recognition result returned by the back-end server, wherein the re-recognition result is obtained by the back-end server re-recognizing the object in the target image based on target position information of a target area, the target position information is obtained by recognizing the target image using a target network model, the target network model includes a region generation model and a region perception model, the region generation model is used to determine position information of sub-regions corresponding to multiple sub-images in the target image, the sub-image including at least one sub-object of the object, and the region perception model is used to determine a target weight of the sub-region, the target weight being used to represent the importance of the sub-region to the target area.
[0009] According to another aspect of an embodiment of the present invention, another object recognition method is provided. The method may include: entering a target image including an object to be recognized in an input interface of a target interface; sensing a position generation instruction in the target interface, and displaying target position information of a target area corresponding to the target image, wherein the target position information is obtained by using position information of sub-areas corresponding to multiple sub-images in the target image and target weights of the sub-areas, wherein the sub-image includes at least one sub-object of the object, and the target weight is used to indicate the importance of the sub-area to the target area; sensing a recognition instruction in the target interface, and displaying a re-recognition result, wherein the re-recognition result is obtained by re-recognizing the object in the target image based on the target position information.
[0010] According to another aspect of an embodiment of the present invention, another object recognition device is provided. The device may include: a first acquisition unit, configured to acquire a target image including an object to be recognized; a first recognition unit, configured to recognize the target image using a target network model to obtain target position information of a target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is configured to determine position information of sub-areas corresponding to a plurality of sub-images in the target image, the sub-image including at least one sub-object of the object, and the region perception model is configured to determine a target weight of the sub-area, the target weight being configured to represent the importance of the sub-area to the target area; and a second recognition unit, configured to re-recognize the object in the target image based on the target position information to obtain a re-recognition result.
[0011] According to another aspect of an embodiment of the present invention, another object recognition device is provided. The device may include: a second acquisition unit, configured to acquire a target image including a pedestrian to be recognized; a third recognition unit, configured to recognize the target image using a target network model to obtain target position information of a target region corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is configured to determine position information of subregions corresponding to a plurality of subimages in the target image, the subimage including at least one sub-part of the pedestrian, and the region perception model is configured to determine a target weight of the subregion, the target weight being configured to indicate the importance of the subregion to the target region; and a fourth recognition unit, configured to re-recognize the pedestrian in the target image based on the target position information to obtain a re-recognition result.
[0012] According to another aspect of an embodiment of the present invention, another object recognition device is provided. The device may include: a first display unit, configured to display a target image including an object to be recognized on a target interface; and a second display unit, configured to display a re-recognition result on the target interface, wherein the re-recognition result is obtained by re-recognizing the object in the target image based on target position information of a target area, the target position information is obtained by recognizing the target image using a target network model, the target network model includes a region generation model and a region perception model, the region generation model is configured to determine position information of sub-regions corresponding to a plurality of sub-images in the target image, the sub-image including at least one sub-object of the object, and the region perception model is configured to determine a target weight of the sub-region, the target weight being configured to indicate the importance of the sub-region to the target area.
[0013] According to another aspect of an embodiment of the present invention, another object recognition device is provided. The device may include: an uploading unit, configured to enable a front-end client to upload a target image including an object to be recognized to a back-end server; and a receiving unit, configured to enable the front-end client to receive a re-recognition result returned by the back-end server, wherein the re-recognition result is obtained by the back-end server re-recognizing the object in the target image based on target position information of a target area, the target position information is obtained by recognizing the target image using a target network model, the target network model includes a region generation model and a region perception model, the region generation model is used to determine position information of sub-regions corresponding to multiple sub-images in the target image, the sub-image including at least one sub-object of the object, and the region perception model is used to determine a target weight of the sub-region, the target weight being used to represent the importance of the sub-region to the target area.
[0014] According to another aspect of the present invention, a computer-readable storage medium is provided, which includes a stored program, wherein when the program is executed by a processor, the device containing the computer-readable storage medium is controlled to execute the object recognition method according to the present invention.
[0015] According to another aspect of an embodiment of the present invention, a processor is provided, which is configured to run a program, wherein the object recognition method of an embodiment of the present invention is executed when the program is run.
[0016] According to another aspect of an embodiment of the present invention, a system for identifying an object is provided. The system may include: a processor; and a memory connected to the processor and configured to provide the processor with instructions for processing the following steps: obtaining a target image including an object to be identified; identifying the target image using a target network model to obtain target position information of a target region corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model being configured to determine position information of subregions corresponding to a plurality of subimages in the target image, the subimages including at least one sub-object of the object; and the region perception model being configured to determine target weights of the subregions, the target weights being configured to indicate the importance of the subregions to the target region; and re-identifying the object in the target image based on the target position information to obtain a re-identification result.
[0017] In an embodiment of the present invention, a target network model is provided, which includes a region generation model and a region perception model, through which a target image is identified to obtain position information of the target region, and then the object in the target image is re-identified through the position information. Therefore, this embodiment does not need to use other semantic information in addition, so the amount of calculation is small and the retrieval efficiency is high. The coordinates of the discriminative and aligned regions can be automatically calculated through the region generation model, which can avoid the generation of occluded regions. For each generated region, the generative region perception network assigns different weights to each sub-region, avoiding the impact of meaningless sub-regions on the network, solving the technical problem of low efficiency in re-identifying objects, and thus improving the technical effect of improving the efficiency of re-identifying objects. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0019] Figure 1 is a hardware structure block diagram of a computer terminal (or mobile device) for implementing an object recognition method according to an embodiment of the present invention;
[0020] Figure 2 is a flow chart of a method for identifying an object according to an embodiment of the present invention;
[0021] Figure 3 is a flow chart of another object recognition method according to an embodiment of the present invention;
[0022] Figure 4 is a flow chart of another object recognition method according to an embodiment of the present invention;
[0023] Figure 5 is a flow chart of another object recognition method according to an embodiment of the present invention;
[0024] FIG6( a ) is a schematic diagram of implementing person re-identification according to a region-based method in the related art;
[0025] FIG6( b ) is a schematic diagram of implementing pedestrian re-identification according to another region-based method in the related art;
[0026] Figure 7 is a schematic diagram of a generative region-aware network for implementing person re-identification according to an embodiment of the present invention;
[0027] FIG8( a ) is a schematic diagram showing the relationship between the number of sub-regions and the average accuracy of person re-identification and region level according to an embodiment of the present invention;
[0028] FIG8( b ) is a schematic diagram showing the relationship between the region ratio, the average precision of person re-identification, and the region level according to an embodiment of the present invention;
[0029] FIG9( a ) is a schematic diagram showing the relationship between the length of a storage library and the average precision and region level of person re-identification according to an embodiment of the present invention;
[0030] FIG9( b ) is a diagram showing the total loss of an invariance perception indicator according to an embodiment of the present invention. Schematic diagram of the relationship between the average precision of pedestrian re-identification and the region level;
[0031] FIG10( a ) is a schematic diagram of a result of pedestrian re-identification using a generative region-aware network according to an embodiment of the present invention;
[0032] FIG10( b ) is a schematic diagram of another result of pedestrian re-identification using a generative region-aware network according to an embodiment of the present invention;
[0033] Figure 11 is a schematic diagram of an object recognition device according to an embodiment of the present invention;
[0034] Figure 12 is a schematic diagram of another object recognition device according to an embodiment of the present invention;
[0035] Figure 13 is a schematic diagram of another object recognition device according to an embodiment of the present invention;
[0036] Figure 14 is a schematic diagram of another object recognition device according to an embodiment of the present invention; and
[0037] Figure 15 It is a structural block diagram of a computer terminal according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0039] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0040] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretations:
[0041] Generative Region-Aware Network (G-RAN), which can generate adaptive regions by leveraging the inherent relationships between images;
[0042] Region Generation Module (RGM), which is used to adaptively predict the coordinates of the region through two cascaded fully connected layers;
[0043] Region Aware Module (RAM),In order to further analyze the regions generated by RGM, RAM is proposed, which assigns weights to each region through the discriminability-aware indicator and the invariance-aware indicator;
[0044] Convolutional Neural Network (CNN) is a feedforward neural network in which artificial neurons can respond to surrounding units and process large images. It includes convolutional layers and pooling layers.
[0045] Example 1
[0046] According to an embodiment of the present invention, an embodiment of a method for identifying an object is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0047] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1FIG is a hardware structure block diagram of a computer terminal (or mobile device) for implementing an object recognition method according to an embodiment of the present invention. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (illustrated as 102a, 102b, ..., 102n) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0048] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components of the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0049] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the object recognition method in the embodiment of the present invention. The processor 102 executes the software programs and modules stored in the memory 104 to perform various functional applications and data processing, that is, to implement the above-mentioned object recognition method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0050] The transmission device 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.
[0051] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0052] It should be noted that, in some optional embodiments, the above Figure 1 The computer device (or mobile device) shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the aforementioned computer device (or mobile device).
[0053] exist Figure 1 Under the operating environment shown, this application provides Figure 2 It should be noted that the object recognition method of this embodiment is based on Figure 1 The illustrated embodiment is executed by a mobile terminal.
[0054] Figure 2 FIG. 1 is a flow chart of a method for identifying an object according to an embodiment of the present invention. Figure 2 As shown, the method may include the following steps:
[0055] Step S202: Acquire a target image including an object to be identified.
[0056] In the technical solution provided in the above step S202 of the present invention, the object is a specific object (object of interest) that needs to be identified, and the target image of the object is obtained by obtaining the target image through an image acquisition device, for example, obtaining the target image through a camera. The target image can be a picture or a video sequence, and no specific limitation is made here.
[0057] Step S204: identifying the target image through the target network model to obtain target position information of the target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model.
[0058] In the technical solution provided in the above step S204 of the present invention, after obtaining a target image including an object to be identified, the target image can be identified through a target network model to obtain target position information of a target area corresponding to the target image, wherein the region generation model in the target network model is used to determine the position information of sub-areas corresponding to multiple sub-images in the target image, the sub-image includes at least one sub-object of the object, and the region perception model in the target network model is used to determine the target weight of the sub-area, and the target weight is used to represent the importance of the sub-area to the target area.
[0059] In this embodiment, the target network model is pre-trained to identify the region corresponding to the input image and obtain the distinguished location information, and can be a generative region-aware network. The target network model of this embodiment can further include a region generative model (RGM) and a region-aware model (RAM).
[0060] Optionally, the target image of this embodiment includes multiple sub-images, which constitute the target image, and each sub-image may include at least one sub-object of the object to be identified. The region generation model of this embodiment can be used to adaptively predict the position information of the sub-regions corresponding to the multiple sub-images in the target image, wherein the sub-regions can also be called generation regions, and the position information can be the coordinates of the sub-regions that are discriminative and aligned. Optionally, the region generation model of this embodiment can predict the position information of the sub-regions corresponding to the multiple sub-images in the target image through effective weak supervision, and the corresponding region classification loss can be used to well align the regions. In order to further analyze the position information of the sub-regions, the target network model of this embodiment may also include a region perception model, which can be used to determine the target weight of each sub-region, and the target weight can be used to represent the importance of the sub-region to the target region. That is, for each sub-region, the region perception model can assign different target weights to each sub-region to determine the reasonable contribution of the sub-region to the target region, thereby avoiding the impact of meaningless sub-regions on the target network model.
[0061] This embodiment inputs the acquired target image into the target network model for recognition, thereby obtaining target position information of the target area corresponding to the target image. The target position information may be the coordinates of the target area.
[0062] Step S206 : re-identify the object in the target image based on the target position information to obtain a re-identification result.
[0063] In the technical solution provided in the above step S206 of the present invention, after the target image is identified through the target network model and the target position information of the target area corresponding to the target image is obtained, the object in the target image can be re-identified based on the target position information to obtain a re-identification result.
[0064] In this embodiment, when re-identifying an object in a target image, the object in the target image may be re-identified based on the target position information of the target area, thereby determining whether a specific object exists in the target image.
[0065] Through the above steps S202 to S206 of the present application, the present application provides a target network model, which includes a region generation model and a region perception model, through which the target image is identified to obtain the position information of the target region, and then the object in the target image is re-identified through the position information. Therefore, this embodiment does not need to use other semantic information in addition, so the amount of calculation is small and the retrieval efficiency is high. The coordinates of the discriminative and aligned regions can be automatically calculated through the region generation model, which can avoid the generation of occluded regions. For each generated region, the generative region perception network assigns different weights to each sub-region, avoiding the impact of meaningless sub-regions on the network, solving the technical problem of low efficiency in re-identifying objects, and thus improving the technical effect of improving the efficiency of re-identifying objects.
[0066] The above method of this embodiment is further introduced below.
[0067] As an optional implementation manner, the target area is an unobstructed area.
[0068] In this embodiment, the coordinates of a target area that is discriminative and aligned can be automatically calculated through the target network model. The target area is an unobstructed area, thereby effectively avoiding the generation of an obstructed area.
[0069] As an optional implementation, in step S204, before the target image is identified through the target network model to obtain the target position information of the target area corresponding to the target image, the method also includes: extracting the feature map of the target image; identifying the target image through the target network model to obtain the target position information of the target area corresponding to the target image, including: identifying the target area corresponding to the feature map through the target network model to obtain the target position information.
[0070] In this embodiment, before the target image is identified by the target network model and the target position information of the target area corresponding to the target image is obtained, the feature map of the target image can be extracted first. Optionally, this embodiment can extract the feature map from the target image through the convolutional neural network model. Wherein, C can be used to represent the channel value of the feature map, H can be used to represent the height of the feature map, and W can be used to represent the width of the feature map. After extracting the feature map of the target image, this embodiment can identify the target area corresponding to the feature map through the target network model, thereby obtaining the target position information of the target area.
[0071] As an optional implementation, step S204 identifies the target area corresponding to the feature map through the target network model to obtain target position information, including: predicting the feature map based on the fully connected layer in the region generation model to obtain the position information of sub-regions corresponding to multiple sub-images; determining the target weight based on the sub-perception model in the region perception model; and determining the target position information based on the sub-region position information and the target weight.
[0072] In this embodiment, the region generation model may include two fully-connected layers (FC), and the region generation model may adaptively predict the location information of the sub-region through the fully connected layers, for example, adaptively predicting the coordinates of the sub-region through the fully connected layers. Optionally, the region perception model of this embodiment may further include a sub-perception model, which may be a discrimination-aware indicator and an invariance-aware indicator. This embodiment may determine the target weight of each sub-region based on the sub-perception model, and then determine the target location information of the final target region based on the location information of each sub-region and the corresponding target weight.
[0073] As an optional implementation, the feature map is predicted based on the fully connected layer in the region generation model to obtain the position information of the sub-regions corresponding to the multiple sub-images, including: performing a maximum pooling operation on the feature map to obtain the pooling result; classifying the pooling result based on the first fully connected layer and the second fully connected layer to obtain the position information of the sub-region, wherein the first fully connected layer and the second fully connected layer are cascaded.
[0074] In this embodiment, when predicting the feature map based on the fully connected layer in the region generation model to obtain the position information of the sub-regions corresponding to the multiple sub-images, the feature map can be first input into the convolution layer to reduce the width of the channel of the feature map, and then the output of the convolution layer is subjected to a maximum pooling operation (max-pooling operation) to obtain a pooling result, and then the pooling result is input into the first fully connected layer and the second fully connected layer for classification to predict the position information of the sub-region. Optionally, the position information of the sub-region in this embodiment can be expressed by the following formula:
[0075] θ=θ j (j=1,...,p)=φ(F, δ, α)
[0076]
[0077] Among them, θ can be used to represent the coordinates of the sub-region, φ can be used to represent the region generation model, δ and α can be used to represent the parameters of the convolution layer and the fully connected layer respectively, and θ j Can be used to represent the coordinates of a sub-region and includes four coordinate parameters They are used to represent the top, left, bottom, and right coordinates respectively.
[0078] As an optional implementation, the target weight is determined based on the sub-perception model in the regional perception model, including: analyzing the features of the sub-region through the self-attention mechanism by the first sub-perception model to obtain the first weight of the sub-region, wherein the first sub-perception model includes a third fully connected layer and an activation function; comparing the sub-region with the regions corresponding to other images having the same identifier as the target image through the second sub-perception model to obtain a comparison result, and determining the second weight of the sub-region based on the comparison result; and determining the sum of the first weight and the second weight as the target weight.
[0079] In this embodiment, the first sub-perception model can be a discriminative perception indicator, and the second sub-model can be an invariance perception indicator. In this embodiment, the first sub-perception model analyzes the features of the sub-region through the self-attention mechanism (f) to obtain a first weight (discriminative weight) of the sub-region, where the features of the sub-region can be expressed by the following formula:
[0080]
[0081] Among them, F R It can be used to represent the characteristics of the sub-region, C1 can be used to represent the number of channels of the feature map after processing through the convolution layer, p can be used to represent the number of sub-regions, F j It can be used to represent the jth feature map. In this embodiment, the features of the sub-region are used as the input of the first sub-perception model, and the target weight of each sub-region is used as the output of the first sub-perception model. Optionally, the first sub-perception model of this embodiment includes a third fully connected layer and an activation function, wherein the third fully connected layer can be a linear fully connected layer and the activation function can be a sigmoid activation function.
[0082] Optionally, the discrimination weight of the j-th sub-region in this embodiment can be expressed by the following formula:
[0083]
[0084] Among them, α j Can be used to represent the discrimination weight of the j-th sub-region, W a It can be used to represent the parameters of the first fully connected layer and the second fully connected layer, and σ can be used to represent the activation function.
[0085] The above-mentioned first sub-perception model of this embodiment can enhance the features used to learn the inherent relationship between multiple sub-images of the target image, and is used to measure the features of each sub-region.
[0086] In order to learn the target weight corresponding to each sub-region, this embodiment can compare the sub-region with the region corresponding to other images having the same identifier as the target image through the second sub-perception model to obtain a comparison result, wherein the identifier can be an identity representation (ID), and then determine the second weight (invariance weight) of the sub-region based on the comparison result. The second sub-perception model of this embodiment is a further supplement to the first sub-perception model, and is used to learn the relationship between multiple sub-regions and the aligned region, wherein multiple sub-regions and the aligned region correspond to the same identifier.
[0087] Optionally, this embodiment creates a target repository in which sub-region features are stored, the target repository including region features of images used to train a second sub-perception model, and the second sub-perception model can be used to compare aligned regions with the same identity.
[0088] Optionally, this embodiment expresses the target storage library by the following formula:
[0089]
[0090] Among them, t can be used to represent the number of training generations, and m can be used to represent the update rate, which can be set to 0.7. Can be passed The result of regularization.
[0091] Optionally, in this embodiment, F can be calculated j and G j The similarity S between j :
[0092]
[0093] Among them, R j Used to represent the j-th sub-region.
[0094] The invariance weight of the j-th subregion (Invariance Weight) can be expressed by the following formula:
[0095]
[0096] in, is a matrix containing similarity scores of L, where L is one of the sizes of the target repository.
[0097] Optionally, this embodiment can use a fully connected layer to Adjustment can be achieved through the following formula:
[0098]
[0099] in, and is the parameter of the fully connected layer, r is the decay rate, which can be 2.
[0100] In this embodiment, the Softmax function can be used to Regularization processing is performed to obtain a second weight of the corresponding sub-region, and then the sum of the first weight and the second weight is determined as the target weight of the target region.
[0101] As an optional embodiment, in step S204, after the target image is identified through the target network model and the target position information of the target area corresponding to the target image is obtained, the method also includes: when the size of the sub-region is not within the target size range, adjusting the size of the sub-region to within the target size range based on the area of the sub-region and the size of the feature map of the target image.
[0102] After the target image is identified through the target network model and the target position information of the target area corresponding to the target image is obtained, it can be determined whether the size of the sub-region is within the target size range. The target size range is a suitable range for limiting the size of the sub-region. The size of the sub-region that is too large or too small needs to be further adjusted. If the size of the sub-region is not within the target size range, the size of the sub-region can be adjusted to within the target size range based on the area of the sub-region and the size of the feature map of the target image. Optionally, this embodiment can adjust the target size range by the following formula to obtain the size of the adjusted sub-region
[0103]
[0104] Wherein, ξ is used to represent the ratio of the size of the sub-region to the size of the entire image (area ratio), S is used to represent the size of the entire feature map, and S=W×H.
[0105] As an optional embodiment, in step S204, after the target image is identified through the target network model and the target position information of the target area corresponding to the target image is obtained, the method further includes: when the aspect ratio of the sub-area is not within the target aspect ratio range, adjusting the aspect ratio of the sub-area to within the target aspect ratio range based on the critical value of the aspect ratio of the sub-area.
[0106] In this embodiment, after the target image is identified by the target network model and the target position information of the target area corresponding to the target image is obtained, the aspect ratio of the sub-area can be further adjusted. In this embodiment, it can be determined whether the aspect ratio of the sub-area is within the target aspect ratio range. If it is determined that the aspect ratio of the sub-area is not within the target aspect ratio range, the aspect ratio of the sub-area can be adjusted to be within the target aspect ratio range based on the critical value of the aspect ratio of the sub-area. This can be achieved by the following formula to obtain the adjusted aspect ratio of the sub-area:
[0107]
[0108] in, It can be used to indicate the aspect ratio. α1 and α2 can be used to indicate the ratio of the aspect ratio, which can be 0.5 and 2 respectively.
[0109] As an optional embodiment, after identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image, the method also includes: when a sub-region overlaps with other sub-regions, adjusting the sub-region based on the degree of overlap between the sub-region and other sub-regions, so that the degree of overlap between the adjusted sub-region and other sub-regions is lower than the degree of overlap between the sub-region and other sub-regions before adjustment.
[0110] In this embodiment, in order to make the sub-region include different features, after the target image is identified by the target network model and the target position information of the target region corresponding to the target image is obtained, the overlap between the sub-region and other sub-regions can be adjusted. The sub-region can be adjusted based on the overlap between the sub-region and other sub-regions. This can be achieved by the following formula to obtain the adjusted overlap:
[0111]
[0112] in, Can be used to calculate θ j and θ k The degree of overlap between them, j≠k, can be used to represent the above sub-regions and other sub-regions respectively.
[0113] As an optional implementation, in step S204, after the target image is identified through the target network model to obtain the target position information of the target area corresponding to the target image, the method also includes: aligning the features of the sub-region with the features of other sub-regions based on the region classification loss of the sub-region.
[0114] In this embodiment, after the target image is identified through the target network model and the target position information of the target area corresponding to the target image is obtained, in order to further restrict the sub-region and better align the features of the sub-region, this embodiment can obtain the regional classification loss of the sub-region, which can well align the features of the sub-region with the features of other sub-regions.
[0115] Optionally, this embodiment may use a parameters-shared classifier to ensure that each subregion is aligned with its pseudo label, and the parameters-shared classifier may be optimized by a region classification loss, which may also be called a classification cross entropy loss. Alternatively, the total loss of the second sub-perception model of this embodiment can be obtained by the following formula:
[0116]
[0117] Among them, λ a ,λ o ,λ align Can be used to express ratios, λ a It can be defaulted to 0.1, λ o It can be defaulted to 0.1, λ align It can default to 0.5.
[0118] As an optional implementation, in step S204, before the target image is identified by the target network model to obtain the target position information of the target area corresponding to the target image, the method also includes: training the target network model based on the loss of global features of the training sample, the loss of regional features and the loss corresponding to the regional generation model.
[0119] In this embodiment, before the target image is recognized by the target network model and the target position information of the target area corresponding to the target image is obtained, the target network model needs to be trained. In the training phase, the target network model can be trained using the loss of the global features of the training sample, the loss of the regional features, and the loss corresponding to the regional generation model. The loss of the global features can be obtained by To express it, the loss of regional features can be expressed by To express it, the loss corresponding to the regional generation model can be the total loss of the second sub-perception model mentioned above
[0120] Optionally, after obtaining the target network model, the embodiment may further test the target network model. In the testing phase, the importance of the sub-region is represented by the target weight of the sub-region.
[0121] The following further introduces the pedestrian recognition scenario of the object recognition method according to the embodiment of the present invention.
[0122] Figure 3 FIG. 1 is a flow chart of another object recognition method according to an embodiment of the present invention. Figure 3 As shown, the method may include the following steps:
[0123] Step S302: Acquire a target image including a pedestrian to be identified.
[0124] In the technical solution provided in step S302 of the present invention, the pedestrian is a specific pedestrian to be identified (pedestrian of interest), and a target image of the pedestrian is obtained. The target image of the pedestrian can be obtained by an image acquisition device. The target image can be a picture or a video sequence, and no specific limitation is made here.
[0125] Step S304: identifying the target image through the target network model to obtain target position information of the target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model.
[0126] In the technical solution provided in the above step S304 of the present invention, after obtaining a target image including a pedestrian to be identified, the target image is identified through a target network model to obtain target position information of a target area corresponding to the target image, wherein the region generation model in the target network model can be used to determine the position information of sub-areas corresponding to multiple sub-images in the target image, and the sub-image may include at least one sub-part of a pedestrian. The region perception model in the target network model is used to determine the target weight of the sub-area, and the target weight is used to indicate the importance of the sub-area to the target area.
[0127] In this embodiment, the target image includes multiple sub-images, and each sub-image may include at least one sub-object of a pedestrian to be identified. The region generation model of this embodiment can be used to adaptively predict the position information of the sub-regions corresponding to the multiple sub-images in the target image, and the position information may be the coordinates of the sub-regions that are discriminative and aligned. Optionally, the region generation model of this embodiment can predict the position information of the sub-regions corresponding to the multiple sub-images in the target image through effective weak supervision, and the corresponding region classification loss can be used to align the regions well. In order to further analyze the position information of the sub-regions, the target network model of this embodiment may also include a region perception model, which may be used to determine the target weight of each sub-region to determine the reasonable contribution of the sub-region to the target region, thereby avoiding the influence of meaningless sub-regions on the target network model.
[0128] This embodiment inputs the acquired target image into the target network model for recognition, thereby obtaining target position information of the target area corresponding to the target image, which may be the coordinates of the target area, wherein the target area is an unobstructed area.
[0129] Step S306 : re-identify the pedestrian in the target image based on the target position information to obtain a re-identification result.
[0130] In the technical solution provided in the above step S306 of the present invention, after the target image is identified through the target network model and the target position information of the target area corresponding to the target image is obtained, the pedestrian in the target image can be re-identified based on the target position information to obtain a re-identification result.
[0131] In this embodiment, when re-identifying a pedestrian in a target image, the pedestrian in the target image can be re-identified based on the target position information of the target area to obtain a re-identification result, thereby determining whether a specific pedestrian exists in the target image. Person re-identification, also known as person re-identification, is a method that uses computer vision technology to determine whether a specific pedestrian exists in an image or video sequence.
[0132] As an optional implementation, before identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image, the method also includes: extracting the feature map of the target image; identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image, including: identifying the target area corresponding to the feature map through the target network model to obtain the target position information.
[0133] In this embodiment, before the target image is identified by the target network model and the target position information of the target area corresponding to the target image is obtained, the feature map of the target image can be extracted first. Optionally, this embodiment can extract the feature map from the target image through the convolutional neural network model. After extracting the feature map of the target image, this embodiment can identify the target area corresponding to the feature map through the target network model, thereby obtaining target position information of the target area.
[0134] The object recognition method of the embodiment of the present invention is introduced below from the perspective of human-computer interaction.
[0135] Figure 4 FIG. 1 is a flow chart of another object recognition method according to an embodiment of the present invention. Figure 4 As shown, the method may include the following steps:
[0136] Step S402: Displaying a target image including an object to be identified on a target interface.
[0137] In the technical solution provided in the above step S402 of the present invention, the target image of the object is obtained by obtaining the target image through an image acquisition device, and then the target image is displayed on the target interface. The target image can be a picture or a video sequence, and no specific limitation is made here.
[0138] Step S404: Display the re-identification result on the target interface, wherein the re-identification result is obtained by re-identifying the object in the target image based on the target position information of the target area, and the target position information is obtained by identifying the target image through the target network model, and the target network model includes a region generation model and a region perception model.
[0139] In the technical solution provided in the above step S402 of the present invention, the region generation model is used to determine the position information of the sub-regions corresponding to multiple sub-images in the target image, the sub-image includes at least one sub-object of the object, and the region perception model is used to determine the target weight of the sub-region, and the target weight is used to represent the importance of the sub-region to the target region.
[0140] In this embodiment, after the target interface displays a target image including an object to be identified, the re-identification result can be displayed on the target interface. Optionally, the target image of this embodiment includes multiple sub-images, each of which can include at least one sub-object of the object to be identified. The region generation model of this embodiment can be used to adaptively predict the position information of sub-regions corresponding to the multiple sub-images in the target image, wherein the position information can be the coordinates of sub-regions that are discriminative and aligned. Optionally, the region generation model of this embodiment can predict the position information of sub-regions corresponding to the multiple sub-images in the target image through effective weak supervision, and the corresponding region classification loss can be used to well align the regions. In order to further analyze the position information of the sub-regions, the target network model of this embodiment can also include a region-aware model, which can be used to determine the target weight of each sub-region. The target weight can be used to represent the importance of the sub-region to the target region. That is, for each sub-region, the region-aware model can assign different target weights to each sub-region to determine the reasonable contribution of the sub-region to the target region, thereby avoiding the impact of meaningless sub-regions on the target network model.
[0141] This embodiment inputs the acquired target image into the target network model for recognition, thereby obtaining the target position information of the target area corresponding to the target image. The target position information can be the coordinates of the target area, and then the object in the target image is re-identified based on the coordinates of the target area to obtain a re-identification result, and then the re-identification result is displayed on the target interface to determine whether there is a specific object in the target image.
[0142] The object recognition method of the embodiment of the present invention is further introduced below from the front-end client side.
[0143] Figure 5 FIG. 1 is a flow chart of another object recognition method according to an embodiment of the present invention. Figure 5 As shown, the method may include the following steps:
[0144] Step S502: the front-end client uploads a target image including an object to be identified to the back-end server.
[0145] In the technical solution provided in the above step S502 of the present invention, the front-end client can first obtain the target image of the object, and then upload the target image to the back-end server, wherein the target image can be a picture or a video sequence, and there is no specific limitation here.
[0146] In step S504, the front-end client receives the re-identification result returned by the back-end server, wherein the re-identification result is obtained by the back-end server re-identifying the object in the target image based on the target position information of the target area, and the target position information is obtained by identifying the target image through the target network model, and the target network model includes a region generation model and a region perception model.
[0147] In the technical solution provided in the above step S504 of the present invention, the region generation model is used to determine the position information of the sub-regions corresponding to multiple sub-images in the target image, the sub-image includes at least one sub-object of the object, and the region perception model is used to determine the target weight of the sub-region, and the target weight is used to represent the importance of the sub-region to the target region.
[0148] In this embodiment, after the front-end client uploads the target image including the object to be identified to the back-end server, the back-end server can re-identify the object in the target image based on the target position information of the target area, obtain a re-identification result, and then send the re-identification result to the front-end client, so that the front-end client receives the re-identification result, and then can display the re-identification result on the display interface of the front-end client.
[0149] Optionally, the target image of this embodiment includes multiple sub-images, each of which may include at least one sub-object of the object to be identified. The above-mentioned region generation model of this embodiment can be used to adaptively predict the position information of the sub-regions corresponding to the multiple sub-images in the target image, wherein the position information may be the coordinates of the sub-regions that are discriminative and aligned. Optionally, the region generation model of this embodiment can predict the position information of the sub-regions corresponding to the multiple sub-images in the target image through effective weak supervision, and the corresponding region classification loss can be used to align the regions well. In order to further analyze the position information of the sub-regions, the target network model of this embodiment may also include a region perception model, which may be used to determine the target weight of each sub-region, and the target weight may be used to represent the importance of the sub-region to the target region, that is, for each sub-region, the region perception model may assign different target weights to each sub-region to determine the reasonable contribution of the sub-region to the target region, thereby avoiding the influence of meaningless sub-regions on the target network model.
[0150] The background server of this embodiment can input the received target image into the target network model for identification, thereby obtaining the target position information of the target area corresponding to the target image. The target position information can be the coordinates of the target area, and then the object in the target image is re-identified based on the coordinates of the target area to obtain a re-identification result, which is sent to the front-end client, and then the re-identification result is displayed on the target interface of the front-end client to determine whether there is a specific object in the target image.
[0151] Another object recognition method according to an embodiment of the present invention is introduced below from the perspective of human-computer interaction.
[0152] As an optional example, the object recognition method of this embodiment may include: entering a target image including an object to be recognized in an entry interface of a target interface; sensing a position generation instruction in the target interface, and displaying target position information of a target area corresponding to the target image, wherein the target position information is obtained by the position information of sub-areas corresponding to multiple sub-images in the target image and the target weight of the sub-area, the sub-image includes at least one sub-object of the object, and the target weight is used to indicate the importance of the sub-area to the target area; sensing an identification instruction in the target interface, and displaying a re-identification result, wherein the re-identification result is obtained by re-identifying the object in the target image based on the target position information.
[0153] In this embodiment, the target interface includes an input interface. In this embodiment, a target image including an object to be identified can be input into this input interface. The object is a specific object to be identified. The input interface can be a target image acquired through an image acquisition device, for example, a target image acquired through a camera. The target image can be a picture or a video sequence, without specific limitation. It should be noted that the input interface of this embodiment can be located anywhere on the target interface, without specific limitation.
[0154] Optionally, this embodiment senses a position generation instruction triggered by a user in the target interface, and the position generation instruction is used to instruct the display of target position information, and then in response to the position generation instruction, the target position information of the target area corresponding to the target image is displayed in the target interface. Optionally, the target image of this embodiment includes multiple sub-images, and the multiple sub-images constitute the target image, and each sub-image may include at least one sub-object of the object to be identified. This embodiment adaptively predicts the position information of the sub-areas corresponding to the multiple sub-images in the target image, wherein the sub-areas can also be called generation areas, and the position information can be the coordinates of the sub-areas that are discriminative and aligned. Optionally, this embodiment can predict the position information of the sub-areas corresponding to the multiple sub-images in the target image through effective weak supervision, and the corresponding region classification loss can be used to align the regions well. In order to further analyze the position information of the sub-areas, this embodiment can also determine the target weight of each sub-area, and the target weight can be used to represent the importance of the sub-area to the target area.
[0155] After obtaining the position information of the sub-regions corresponding to the multiple sub-images in the target image and the target weights of the sub-regions, this embodiment can use the position information of the sub-regions corresponding to the multiple sub-images and the target weights of the sub-regions to comprehensively determine the above-mentioned target position information, and can determine the above-mentioned target position information based on the product of the position information of the sub-regions corresponding to the multiple sub-images and the target weights of the sub-regions.
[0156] After determining the above-mentioned target position information using the position information of the sub-areas corresponding to multiple sub-images and the target weights of the sub-areas, the target interface of this embodiment can receive a recognition instruction triggered by the user, which is used to instruct the re-identification of the object in the target image, and then respond to the recognition instruction, re-identify the object in the target image based on the determined target position information, obtain a re-identification result, and then display the re-identification result on the target interface.
[0157] In this embodiment, when re-identifying an object in a target image, the object in the target image can be re-identified based on the target position information of the target area, thereby determining whether a specific object exists in the target image, thereby achieving the purpose of determining whether a specific object exists in the target image.
[0158] In the related art, object recognition can be a region-based method, which can directly divide the image of the object into fixed horizontal stripes to obtain richer fine-grained local features, but the fixed horizontal stripes may not be able to handle severe misalignment between images and cannot eliminate the influence of background or occlusion. In addition, a learnable grid can be used to automatically generate regions. However, the importance of different generated regions has not been studied in detail, making it difficult to deal with occluded regions or regional misalignment problems. Furthermore, the attention-based method in this field learns attention weights in a self-supervised manner to obtain representative features, and the weights are generated based on each single image, and the inherent relationships between images are ignored. Therefore, how to use the inherent relationships between images to generate adaptive regions and tap into more powerful features is an important issue for achieving effective object recognition.
[0159] However, this embodiment provides a target network model, which includes a region generation model and a region perception model, through which the target image is identified to obtain the position information of the target region, and then the object in the target image is re-identified through the position information. Therefore, this embodiment does not need to use other semantic information in addition, so the amount of calculation is small and the retrieval efficiency is high. The region generation model can automatically calculate the coordinates of the discriminative and aligned regions, which can avoid the generation of occluded regions. For each generated region, the generative region perception network assigns different weights to each sub-region, avoiding the impact of meaningless sub-regions on the network, solving the technical problem of low efficiency in re-identifying objects, and thus improving the technical effect of improving the efficiency of re-identifying objects.
[0160] Example 2
[0161] The following further introduces the preferred implementation of the above method of this embodiment, specifically taking object recognition as pedestrian re-identification as an example.
[0162] When implementing pedestrian re-identification, it remains challenging due to the difficulty in detecting partially occluded areas, accurately detecting pedestrians, and extracting discriminative and robust regions due to changes in human posture and camera perspective.
[0163] In a related art, a region-based method can be used to implement pedestrian re-identification. FIG6(a) is a schematic diagram of implementing pedestrian re-identification according to a region-based method in the related art, and FIG6(b) is a schematic diagram of implementing pedestrian re-identification according to another region-based method in the related art. Figure 6(a) and 6(b)As shown in Figure 2, pedestrian images can be directly divided into fixed horizontal stripes, and each part has the same weight (0.167) to obtain richer fine-grained local features. However, this fixed horizontal stripe may not be able to handle severe misalignment between images and cannot eliminate the influence of background or occluded areas.
[0164] In another related technique, regions can be automatically generated through a learnable grid. However, this method has not yet well studied the importance of different generated regions, which is fatal when dealing with occluded regions or misalignment problems.
[0165] In another related technology, attention-based methods can learn attention weights in a self-supervised manner to obtain representative features. However, the weights are generated based on each single image, and the inherent relationships between images are often ignored. Therefore, how to utilize the inherent relationships between images to generate adaptive regions and mine more powerful features is a crucial issue.
[0166] In response to the above problems, the technical solutions of this application are introduced below.
[0167] Figure 7 FIG is a schematic diagram of a generative region perception network for implementing person re-identification according to an embodiment of the present invention. Figure 7 As shown, a generative region awareness network (G-RAN) can include a region generation model (RGM) and a region awareness model (RAM), where the RGM adaptively predicts the coordinates of the region through two cascaded fully connected layers (FC).
[0168] This embodiment can first extract the feature map of the target image to be identified (identified as ID: 1). Optionally, this embodiment can extract the feature map from the target image through a convolutional neural network model (Conv) Among them, C can be used to represent the channel value of the feature map, H can be used to represent the height of the feature map, and W can be used to represent the width of the feature map. After extracting the feature map of the target image, this embodiment can predict the feature map based on the fully connected layer in the region generation model to obtain the position information of the sub-regions corresponding to the multiple sub-images. Optionally, this embodiment can input the feature map into the convolution layer (Conv) to reduce the width of the channel of the feature map, and then perform a max-pooling operation on the output result of the convolution layer to obtain a pooling result, and then input the pooling result into the first fully connected layer (FC) and the second fully connected layer (FC) for classification to predict the position information of the sub-region. Optionally, the position information of the sub-region of this embodiment can be expressed by the following formula:
[0169] θ=θ j(j=1,...,p)=φ(F, δ, α)
[0170]
[0171] Among them, θ can be used to represent the coordinates of the sub-region, φ can be used to represent the region generation model, δ and α are used to represent the parameters of the convolution layer and the fully connected layer respectively, and θ j Used to represent the coordinates of the sub-region and includes four coordinate parameters They are used to represent the top, left, bottom, and right coordinates respectively.
[0172] Optionally, in this embodiment, the RAM may further include two region-aware modules, namely, a discriminative-aware indicator and an invariance-aware indicator. The discriminative-aware indicator may use the symbol f to represent the self-attention mechanism to calculate the distinctive features of each region, which may be used to determine the discriminative weight α. The repository may store the features of the generated regions. In order to learn the invariance weight, the invariance-aware indicator may compare the region of a given image with the corresponding region from other images belonging to the same ID through the repository, which may be used to determine the invariance weight.
[0173] Optionally, this embodiment uses the discriminability perception indicator to analyze the features of the sub-region through a self-attention mechanism (f) to obtain the discriminability weight of the sub-region, wherein the features of the sub-region can be expressed by the following formula:
[0174]
[0175] Among them, F R It can be used to represent the features of the sub-region, C1 can be used to represent the number of channels of the feature map after processing through the convolution layer, and p can be used to represent the number of sub-regions, for example, 6, F j This embodiment uses the features of the sub-region as the input of the first sub-perception model and the target weight of each sub-region as the output of the first sub-perception model. g It is used to represent global features and is obtained through the global average pooling operation (Global Average Pooling, referred to as GAP).
[0176] The discrimination weight of the sub-region of this embodiment can be implemented by the following formula:
[0177]
[0178] Among them, α jUsed to represent the weight of the j-th sub-region (discriminative weight, Discriminative Weight), W a It is used to represent the parameters of the first and second fully connected layers, and σ is used to represent the activation function.
[0179] Optionally, this embodiment creates a target repository in which sub-region features are stored. The target repository includes region features of the image used to train the second sub-perception model, and the second sub-perception model can be used to compare aligned regions with the same identifier. Optionally, the length of the target repository in this embodiment can be set to an empirical value of 20.
[0180] Optionally, this embodiment expresses the repository by the following formula:
[0181]
[0182] Among them, t can be used to represent the number of training generations, and m can be used to represent the update rate, which can be set to 0.7. Can be passed The regularization result of .
[0183] Optionally, in this embodiment, F can be calculated j and G j The similarity S between j :
[0184]
[0185] Among them, R j Used to represent the j-th sub-region.
[0186] Average weight It can be expressed by the following formula:
[0187]
[0188] in, is a matrix containing similarity scores of L, where L is one of the sizes of the target repository.
[0189] Optionally, this embodiment can use a fully connected layer to Adjustment can be achieved through the following formula:
[0190]
[0191] in, and is the parameter of the fully connected layer, r is the decay rate, which can be 2.
[0192] In this embodiment, the Softmax function can be used to Regularization processing is performed to obtain the invariance weight of the corresponding sub-region, and then the sum of the discrimination weight and the invariance weight is determined as the target weight of the target region.
[0193] Figure 8(a) is a diagram illustrating the relationship between the number of subregions and the mean average precision (mAP) of person re-ID and region rank according to an embodiment of the present invention. As shown in Figure 8(a), when the number of subregions exceeds 6, the mean average precision (mAP) of person re-ID and region rank decrease; whereas when the number of subregions does not exceed 6, the mAP and region rank increase.
[0194] Figure 8(b) is a schematic diagram showing the relationship between the region ratio, the average precision of person re-ID, and the region level according to an embodiment of the present invention. As shown in Figure 8(b), when the region ratio exceeds 0.125, the average precision of person re-ID or the region level decreases; while when the region ratio does not exceed 0.125, the average precision of person re-ID or the region level increases. The region ratio is the ratio of the size of the subregion to the size of the entire image.
[0195] Figure 9(a) is a diagram illustrating the relationship between the length of a storage library and the average precision and region level of person re-ID according to an embodiment of the present invention. As shown in Figure 9(a), when the storage library length exceeds 20, the average precision and region level of person re-ID decrease; however, when the storage library length does not exceed 20, the average precision and region level of person re-ID increase.
[0196] In this embodiment, during the training phase, the total loss of the invariance-aware indicator can be The loss of regional features corresponding to the training samples (Lr) and the loss of global features (Lg) are jointly optimized in G-RAN to learn discriminative and invariant features.
[0197] FIG9( b ) is a diagram showing the total loss of an invariance perception indicator according to an embodiment of the present invention. Schematic diagram of the relationship between the average precision of pedestrian re-identification and the region level. As shown in Figure 9(b), when When it is between 0.5 and 1.0, the average precision and region level of person re-identification do not change significantly.
[0198] Figure 10(a) is a schematic diagram of a result of pedestrian re-identification using a generative region perception network according to an embodiment of the present invention. Figure 10(b) is a schematic diagram of another result of pedestrian re-identification using a generative region perception network according to an embodiment of the present invention. Figure 10(a) and 10(b)As shown, the generative region perception network of this embodiment can adaptively avoid the influence of background and occluded areas when re-identifying pedestrians, and the weight of the area of each part is different, and the weight of the area of each part is used to represent the importance of the area.
[0199] This embodiment proposes a simple and effective generative region-aware network (G-RAN) for pedestrian re-identification, in which a region generation module (RGM) is designed to generate regions for pedestrian re-identification through an effective weak supervision paradigm, and the region classification loss can be used to align the regions well; in G-RAN, in order to further analyze the generated regions, this embodiment also proposes a region awareness module (RAM), which can assign weights to each region through the discriminability-aware indicator and invariance-aware indicator therein, thereby learning the reasonable contribution value of a given region; G-RAN of this embodiment can achieve state-of-the-art performance on multiple benchmark datasets including the dataset Market-1501, the dataset DukeMTMC-reID and the dataset CUHK03-NP. In addition to the normal pedestrian re-identification problem, G-RAN also makes significant improvements on the occluded pedestrian re-identification task, and on the occluded dataset DukeMTMC, its state-of-the-art performance in Rank-1 exceeds 6.8%.
[0200] This embodiment does not require additional use of human semantic information through the above method, so the calculation amount is small and the retrieval efficiency is high; the coordinates of the discriminative and aligned regions are automatically calculated through the network, avoiding the generation of occluded regions; for each generated region, the generative region perception network can assign different weights to each region, thereby avoiding the impact of meaningless regions on the network.
[0201] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0202] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0203] Example 3
[0204] According to an embodiment of the present invention, there is also provided a method for implementing the above Figure 2 The object recognition method of the illustrated embodiment includes an object recognition device.
[0205] Figure 11 FIG is a schematic diagram of an object recognition device according to an embodiment of the present invention. Figure 11 As shown, the object recognition device 110 may include: a first acquisition unit 111 , a first recognition unit 112 and a second recognition unit 113 .
[0206] The first acquiring unit 111 is configured to acquire a target image including an object to be identified.
[0207] The first recognition unit 112 is used to recognize the target image through the target network model to obtain the target position information of the target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is used to determine the position information of the sub-areas corresponding to multiple sub-images in the target image, the sub-image includes at least one sub-object of the object, and the region perception model is used to determine the target weight of the sub-area, and the target weight is used to represent the importance of the sub-area to the target area.
[0208] The second recognition unit 113 is configured to re-recognize the object in the target image based on the target position information to obtain a re-recognition result.
[0209] It should be noted that the first acquisition unit 111, the first identification unit 112, and the second identification unit 113 described above correspond to steps S202 to S206 in Example 1. The examples and application scenarios implemented by the three units and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above units, as part of the device, can be run in the computer terminal 10 provided in Example 1.
[0210] According to an embodiment of the present invention, another method for implementing the above Figure 3 The object recognition method of the illustrated embodiment includes an object recognition device.
[0211] Figure 12 FIG. 1 is a schematic diagram of another object recognition device according to an embodiment of the present invention. Figure 12 As shown, the object recognition device 120 may include: a second acquisition unit 121 , a third recognition unit 122 and a fourth recognition unit 123 .
[0212] The second acquiring unit 121 is configured to acquire a target image including a pedestrian to be identified.
[0213] The third recognition unit 122 is used to recognize the target image through the target network model to obtain the target position information of the target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model. The region generation model is used to determine the position information of the sub-areas corresponding to multiple sub-images in the target image, and the sub-image includes at least one sub-part of the pedestrian. The region perception model is used to determine the target weight of the sub-area, and the target weight is used to represent the importance of the sub-area to the target area.
[0214] The fourth recognition unit 123 is configured to re-recognize the pedestrian in the target image based on the target position information to obtain a re-recognition result.
[0215] It should be noted that the second acquisition unit 121, the third identification unit 122, and the fourth identification unit 123 correspond to steps S302 to S306 in Example 1. The examples and application scenarios implemented by the three units and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above units, as part of the device, can be run in the computer terminal 10 provided in Example 1.
[0216] According to an embodiment of the present invention, another method for implementing the above Figure 4 The object recognition method of the illustrated embodiment includes an object recognition device.
[0217] Figure 13 FIG. 1 is a schematic diagram of another object recognition device according to an embodiment of the present invention. Figure 13 As shown, the object recognition device 130 may include: a first display unit 131 and a second display unit 132 .
[0218] The first display unit 131 is configured to display a target image including an object to be identified on a target interface.
[0219] The second display unit 132 is used to display the re-identification result on the target interface, wherein the re-identification result is obtained by re-identifying the object in the target image based on the target position information of the target area, the target position information is obtained by identifying the target image through the target network model, the target network model includes a region generation model and a region perception model, the region generation model is used to determine the position information of the sub-regions corresponding to multiple sub-images in the target image, the sub-image includes at least one sub-object of the object, and the region perception model is used to determine the target weight of the sub-region, and the target weight is used to indicate the importance of the sub-region to the target area.
[0220] It should be noted that the first display unit 131 and the second display unit 132 correspond to steps S402 to S404 in Example 1. The examples and application scenarios implemented by the two units and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above units, as part of the device, can be run in the computer terminal 10 provided in Example 1.
[0221] According to an embodiment of the present invention, another method for implementing the above Figure 5 The object recognition method of the illustrated embodiment includes an object recognition device.
[0222] Figure 14 FIG. 1 is a schematic diagram of another object recognition device according to an embodiment of the present invention. Figure 14 As shown, the object recognition device 140 may include an uploading unit 141 and a receiving unit 142 .
[0223] The uploading unit 141 is configured to enable the front-end client to upload a target image including an object to be identified to the back-end server.
[0224] The receiving unit 142 is used to enable the front-end client to receive the re-identification result returned by the back-end server, wherein the re-identification result is obtained by the back-end server re-identifying the object in the target image based on the target position information of the target area, and the target position information is obtained by identifying the target image through the target network model. The target network model includes a region generation model and a region perception model. The region generation model is used to determine the position information of sub-regions corresponding to multiple sub-images in the target image, and the sub-image includes at least one sub-object of the object. The region perception model is used to determine the target weight of the sub-region, and the target weight is used to represent the importance of the sub-region to the target area.
[0225] It should be noted that the uploading unit 141 and the receiving unit 142 correspond to steps S502 to S504 in Example 1. The examples and application scenarios implemented by the two units and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the above-mentioned units, as part of the device, can be run in the computer terminal 10 provided in Example 1.
[0226] In the object recognition device of this embodiment, a target network model is provided, which includes a region generation model and a region perception model, through which the target image is recognized to obtain the position information of the target region, and then the object in the target image is re-identified through the position information. Therefore, this embodiment does not need to use other semantic information in addition, so the amount of calculation is small and the retrieval efficiency is high. The coordinates of the discriminative and aligned regions can be automatically calculated through the region generation model, which can avoid the generation of occluded regions. For each generated region, the generative region perception network assigns different weights to each sub-region, avoiding the impact of meaningless sub-regions on the network, solving the technical problem of low efficiency in re-identifying objects, and thus improving the technical effect of improving the efficiency of re-identifying objects.
[0227] Example 4
[0228] An embodiment of the present invention may provide an object recognition system, which may include a computer terminal, which may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may be replaced by a terminal device such as a mobile terminal.
[0229] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of a computer network.
[0230] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the object recognition method: obtaining a target image including the object to be recognized; recognizing the target image through a target network model to obtain target position information of a target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is used to determine the position information of sub-areas corresponding to multiple sub-images in the target image, the sub-image includes at least one sub-object of the object, and the region perception model is used to determine the target weight of the sub-area, and the target weight is used to indicate the importance of the sub-area to the target area; re-identifying the object in the target image based on the target position information to obtain a re-identification result.
[0231] Optionally, Figure 15 1 is a block diagram of a computer terminal according to an embodiment of the present invention. Figure 15As shown, the computer terminal A may include: one or more (only one is shown in the figure) processors 1502 , a memory 1504 , and a transmission device 1506 .
[0232] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the object recognition method and device in the embodiments of the present invention. The processor executes the software programs and modules stored in the memory to perform various functional applications and data processing, thereby implementing the above-mentioned object recognition method. The memory can include high-speed random access memory and can also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory can further include memory remotely located relative to the processor, and these remote memories can be connected to the computer terminal A via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0233] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain a target image including an object to be identified; identify the target image through a target network model to obtain target position information of a target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is used to determine the position information of sub-areas corresponding to multiple sub-images in the target image, the sub-image includes at least one sub-object of the object, and the region perception model is used to determine the target weight of the sub-area, and the target weight is used to represent the importance of the sub-area to the target area; re-identify the object in the target image based on the target position information to obtain a re-identification result.
[0234] Optionally, the above-mentioned processor can also execute the program code of the following steps: extracting the feature map of the target image before identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image; identifying the target area corresponding to the feature map through the target network model to obtain the target position information.
[0235] Optionally, the processor may also execute the program code of the following steps: predicting the feature map based on the fully connected layer in the region generation model to obtain the position information of the sub-regions corresponding to the multiple sub-images; determining the target weight based on the sub-perception model in the region perception model; and determining the target position information based on the sub-region position information and the target weight.
[0236] Optionally, the processor may also execute the program code of the following steps: performing a maximum pooling operation on the feature map to obtain a pooling result; classifying the pooling result based on the first fully connected layer and the second fully connected layer to obtain the location information of the sub-region, wherein the first fully connected layer and the second fully connected layer are cascaded.
[0237] Optionally, the processor may also execute the program code of the following steps: analyzing the features of the sub-region through the self-attention mechanism by the first sub-perception model to obtain a first weight of the sub-region, wherein the first sub-perception model includes a third fully connected layer and an activation function; comparing the sub-region with regions corresponding to other images having the same identifier as the target image through the second sub-perception model to obtain a comparison result, and determining a second weight of the sub-region based on the comparison result; and determining the sum of the first weight and the second weight as the target weight.
[0238] Optionally, the processor may also execute the program code of the following steps: after identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image, if the size of the sub-region is not within the target size range, the size of the sub-region is adjusted to within the target size range based on the area of the sub-region and the size of the feature map of the target image.
[0239] Optionally, the processor may also execute the program code of the following steps: after identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image, if the aspect ratio of the sub-area is not within the target aspect ratio range, the aspect ratio of the sub-area is adjusted to within the target aspect ratio range based on the critical value of the aspect ratio of the sub-area.
[0240] Optionally, the processor may also execute the program code of the following steps: after identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image, when the sub-region overlaps with other sub-regions, the sub-region is adjusted based on the degree of overlap between the sub-region and other sub-regions, so that the degree of overlap between the adjusted sub-region and other sub-regions is lower than the degree of overlap between the sub-region and other sub-regions before adjustment.
[0241] Optionally, the processor may also execute the program code of the following steps: after identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image, aligning the features of the sub-region with the features of other sub-regions based on the regional classification loss of the sub-region.
[0242] Optionally, the above-mentioned processor can also execute the program code of the following steps: before identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image, the target network model is trained based on the loss of global features of the training sample, the loss of regional features and the loss corresponding to the regional generation model.
[0243] As an optional embodiment, the processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain a target image including the pedestrian to be identified; identify the target image through the target network model to obtain the target position information of the target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is used to determine the position information of the sub-regions corresponding to multiple sub-images in the target image, the sub-image includes at least one sub-part of the pedestrian, and the region perception model is used to determine the target weight of the sub-region, and the target weight is used to indicate the importance of the sub-region to the target area; re-identify the pedestrian in the target image based on the target position information to obtain a re-identification result.
[0244] Optionally, the above-mentioned processor can also execute the program code of the following steps: extracting the feature map of the target image before identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image; identifying the target area corresponding to the feature map through the target network model to obtain the target position information.
[0245] As an optional embodiment, the processor can call the information and application stored in the memory through the transmission device to perform the following steps: displaying a target image including an object to be identified on the target interface; displaying a re-identification result on the target interface, wherein the re-identification result is obtained by re-identifying the object in the target image based on the target position information of the target area, and the target position information is obtained by identifying the target image through a target network model. The target network model includes a region generation model and a region perception model. The region generation model is used to determine the position information of sub-regions corresponding to multiple sub-images in the target image, and the sub-image includes at least one sub-object of the object. The region perception model is used to determine the target weight of the sub-region, and the target weight is used to indicate the importance of the sub-region to the target area.
[0246] As an optional embodiment, the processor can call the information and application stored in the memory through the transmission device to perform the following steps: the front-end client uploads the target image including the object to be identified to the back-end server; the front-end client receives the re-identification result returned by the back-end server, wherein the re-identification result is obtained by the back-end server re-identifying the object in the target image based on the target position information of the target area, the target position information is obtained by identifying the target image through the target network model, the target network model includes a region generation model and a region perception model, the region generation model is used to determine the position information of the sub-regions corresponding to multiple sub-images in the target image, the sub-image includes at least one sub-object of the object, and the region perception model is used to determine the target weight of the sub-region, and the target weight is used to indicate the importance of the sub-region to the target area.
[0247] As an optional embodiment, the processor can call the information and application stored in the memory through the transmission device to perform the following steps: entering a target image including the object to be identified in the input interface of the target interface; sensing a position generation instruction in the target interface, and displaying the target position information of the target area corresponding to the target image, wherein the target position information is obtained by the position information of the sub-areas corresponding to multiple sub-images in the target image and the target weight of the sub-area, the sub-image includes at least one sub-object of the object, and the target weight is used to indicate the importance of the sub-area to the target area; sensing an identification instruction in the target interface, and displaying a re-identification result, wherein the re-identification result is obtained by re-identifying the object in the target image based on the target position information.
[0248] An embodiment of the present invention provides an object recognition method. The method may include: obtaining a target image including an object to be recognized; recognizing the target image using a target network model to obtain target position information of a target region corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is used to determine position information of subregions corresponding to multiple subimages in the target image, the subimage including at least one sub-object of the object; the region perception model is used to determine target weights of the subregions, the target weights being used to represent the importance of the subregions to the target region; and re-recognizing the object in the target image based on the target position information to obtain a re-recognition result. That is to say, the present application provides a target network model, which includes a region generation model and a region perception model, through which the target image is identified to obtain the position information of the target region, and then the object in the target image is re-identified through the position information. Therefore, this embodiment does not require the additional use of other semantic information, so the amount of calculation is small and the retrieval efficiency is high. The region generation model can automatically calculate the coordinates of the discriminative and aligned regions, which can avoid the generation of occluded regions. For each generated region, the generative region perception network assigns different weights to each sub-region, avoiding the impact of meaningless sub-regions on the network, solving the technical problem of low efficiency in re-identifying objects, and thus improving the technical effect of improving the efficiency of re-identifying objects.
[0249] It can be understood by those skilled in the art that Figure 15 The structure shown is for illustration only. The computer terminal A may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, a mobile Internet device (MID), a PAD, or other terminal devices. Figure 15 It does not limit the structure of the above-mentioned computer terminal A. For example, the computer terminal A may also include Figure 15More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 15 Different configurations shown.
[0250] A person skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0251] Example 5
[0252] The embodiment of the present invention further provides a computer-readable storage medium. Optionally, in this embodiment, the computer-readable storage medium can be used to store the program code executed by the object recognition method provided in the first embodiment.
[0253] Optionally, in this embodiment, the computer storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0254] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: obtaining a target image including an object to be identified; identifying the target image through a target network model to obtain target position information of a target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is used to determine the position information of sub-areas corresponding to multiple sub-images in the target image, the sub-image includes at least one sub-object of the object, and the region perception model is used to determine the target weight of the sub-area, and the target weight is used to represent the importance of the sub-area to the target area; re-identifying the object in the target image based on the target position information to obtain a re-identification result.
[0255] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: extracting a feature map of the target image before identifying the target image through the target network model to obtain target position information of the target area corresponding to the target image; identifying the target area corresponding to the feature map through the target network model to obtain target position information.
[0256] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: predicting the feature map based on the fully connected layer in the region generation model to obtain position information of sub-regions corresponding to multiple sub-images; determining the target weight based on the sub-perception model in the region perception model; determining the target position information based on the sub-region position information and the target weight.
[0257] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: performing a maximum pooling operation on the feature map to obtain a pooling result; classifying the pooling result based on the first fully connected layer and the second fully connected layer to obtain location information of the sub-region, wherein the first fully connected layer and the second fully connected layer are cascaded.
[0258] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: analyzing the features of the sub-region through a self-attention mechanism by a first sub-perception model to obtain a first weight of the sub-region, wherein the first sub-perception model includes a third fully connected layer and an activation function; comparing the sub-region with regions corresponding to other images having the same identifier as the target image through a second sub-perception model to obtain a comparison result, and determining a second weight of the sub-region based on the comparison result; and determining the sum of the first weight and the second weight as the target weight.
[0259] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: after identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image, if the size of the sub-region is not within the target size range, the size of the sub-region is adjusted to within the target size range based on the area of the sub-region and the size of the feature map of the target image.
[0260] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: after identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image, if the aspect ratio of the sub-area is not within the target aspect ratio range, the aspect ratio of the sub-area is adjusted to within the target aspect ratio range based on the critical value of the aspect ratio of the sub-area.
[0261] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: after identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image, when the sub-region overlaps with other sub-regions, the sub-region is adjusted based on the degree of overlap between the sub-region and the other sub-regions, so that the degree of overlap between the adjusted sub-region and the other sub-regions is lower than the degree of overlap between the sub-region and the other sub-regions before the adjustment.
[0262] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: after identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image, aligning the features of the sub-region with the features of other sub-regions based on the region classification loss of the sub-region.
[0263] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: before identifying the target image through the target network model and obtaining the target position information of the target area corresponding to the target image, the target network model is trained based on the loss of global features of the training sample, the loss of regional features and the loss corresponding to the regional generation model.
[0264] As an optional embodiment, a computer-readable storage medium is configured to store program code for performing the following steps: obtaining a target image including a pedestrian to be identified; identifying the target image through a target network model to obtain target position information of a target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is used to determine the position information of sub-areas corresponding to multiple sub-images in the target image, the sub-image includes at least one sub-part of the pedestrian, and the region perception model is used to determine the target weight of the sub-area, and the target weight is used to indicate the importance of the sub-area to the target area; re-identifying the pedestrian in the target image based on the target position information to obtain a re-identification result.
[0265] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: extracting a feature map of the target image before identifying the target image through the target network model to obtain target position information of the target area corresponding to the target image; identifying the target area corresponding to the feature map through the target network model to obtain target position information.
[0266] As an optional embodiment, a computer-readable storage medium is configured to store program code for performing the following steps: displaying a target image including an object to be identified on a target interface; displaying a re-identification result on the target interface, wherein the re-identification result is obtained by re-identifying the object in the target image based on target position information of the target area, the target position information is obtained by identifying the target image through a target network model, the target network model includes a region generation model and a region perception model, the region generation model is used to determine the position information of sub-regions corresponding to multiple sub-images in the target image, the sub-image includes at least one sub-object of the object, and the region perception model is used to determine the target weight of the sub-region, and the target weight is used to indicate the importance of the sub-region to the target area.
[0267] As an optional embodiment, a computer-readable storage medium is configured to store program code for executing the following steps: a front-end client uploads a target image including an object to be identified to a back-end server; the front-end client receives a re-identification result returned by the back-end server, wherein the re-identification result is obtained by the back-end server re-identifying the object in the target image based on the target position information of the target area, the target position information is obtained by identifying the target image through a target network model, the target network model includes a region generation model and a region perception model, the region generation model is used to determine the position information of sub-regions corresponding to multiple sub-images in the target image, the sub-image includes at least one sub-object of the object, and the region perception model is used to determine the target weight of the sub-region, and the target weight is used to indicate the importance of the sub-region to the target area.
[0268] As an optional embodiment, a computer-readable storage medium is configured to store program code for executing the following steps: entering a target image including an object to be identified in an entry interface of a target interface; sensing a position generation instruction in the target interface, and displaying target position information of a target area corresponding to the target image, wherein the target position information is obtained by using position information of sub-areas corresponding to multiple sub-images in the target image and target weights of the sub-areas, the sub-image including at least one sub-object of the object, and the target weight being used to indicate the importance of the sub-area to the target area; sensing an identification instruction in the target interface, and displaying a re-identification result, wherein the re-identification result is obtained by re-identifying the object in the target image based on the target position information.
[0269] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0270] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0271] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0272] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0273] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0274] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.
[0275] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A method for identifying an object, characterized in that: include: acquiring a target image including an object to be identified; Identifying the target image through a target network model to obtain target position information of a target region corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is used to determine position information of subregions corresponding to a plurality of subimages in the target image, the subimage including at least one sub-object of the object, and the region perception model is used to determine a target weight of the subregion, the target weight being used to represent the importance of the subregion to the target region; re-identifying the object in the target image based on the target position information to obtain a re-identification result; The region generation model includes two cascaded fully connected layers, and the region generation model is used to predict the position information of the sub-region through the two cascaded fully connected layers. The region perception model includes a discriminability perception indicator and an invariance perception indicator, and the region perception model is used to assign the target weight to the sub-region through the discriminability perception indicator and the invariance perception indicator. The discriminability perception indicator is used to calculate the distinguishing features of each of the sub-regions through a self-attention mechanism, and obtain a first weight of the sub-region based on the distinguishing features; the invariance perception indicator is used to compare the sub-region with regions corresponding to other images having the same identifier as the target image, obtain a comparison result, and determine a second weight of the sub-region based on the comparison result; and determine the target weight based on the first weight and the second weight. Among them, identifying the target image through the target network model to obtain the target position information of the target area corresponding to the target image includes: identifying the target area corresponding to the feature map of the target image through the target network model to obtain the target position information.
2. The method according to claim 1, characterized in that The target area is an unobstructed area.
3. The method according to claim 1, characterized in that Before identifying the target image through a target network model to obtain target position information of a target area corresponding to the target image, the method further includes: extracting the feature map of the target image.
4. The method according to claim 3, characterized in that Identifying the target area corresponding to the feature map through the target network model to obtain the target location information includes: Predicting the feature map based on the fully connected layer in the region generation model to obtain position information of the sub-regions corresponding to the multiple sub-images; Determining the target weight based on the sub-perception model in the regional perception model; The target position information is determined based on the position information of the sub-region and the target weight.
5. The method according to claim 4, characterized in that Predicting the feature map based on the fully connected layer in the region generation model to obtain position information of the sub-regions corresponding to the multiple sub-images, including: Performing a maximum pooling operation on the feature map to obtain a pooling result; The pooling result is classified based on a first fully connected layer and a second fully connected layer to obtain position information of the sub-region, wherein the first fully connected layer and the second fully connected layer are cascaded.
6. The method according to claim 4, characterized in that Determining the target weight based on the sub-perception model in the regional perception model includes: Analyzing the features of the sub-region using a self-attention mechanism using a first sub-perception model to obtain a first weight of the sub-region, wherein the first sub-perception model includes a third fully connected layer and an activation function, and the first sub-perception model is the discriminative perception indicator; comparing the sub-region with regions corresponding to other images having the same identifier as the target image using a second sub-perception model to obtain a comparison result, and determining a second weight for the sub-region based on the comparison result, wherein the second sub-perception model is the invariance perception indicator; The sum of the first weight and the second weight is determined as the target weight.
7. The method according to claim 6, characterized in that The features of the sub-region are stored in a target repository.
8. The method according to any one of claims 1 to 7, characterized in that After identifying the target image through the target network model and obtaining target position information of the target area corresponding to the target image, the method further includes: If the size of the sub-region is not within the target size range, the size of the sub-region is adjusted to be within the target size range based on the area of the sub-region and the size of the feature map of the target image.
9. The method according to any one of claims 1 to 7, characterized in that After identifying the target image through the target network model and obtaining target position information of the target area corresponding to the target image, the method further includes: When the aspect ratio of the sub-region is not within the target aspect ratio range, the aspect ratio of the sub-region is adjusted to be within the target aspect ratio range based on a critical value of the aspect ratio of the sub-region.
10. The method according to any one of claims 1 to 7, characterized in that After identifying the target image through the target network model and obtaining target position information of the target area corresponding to the target image, the method further includes: In the case where the subregion overlaps with other subregions, the subregion is adjusted based on the degree of overlap between the subregion and the other subregions, so that the degree of overlap between the adjusted subregion and the other subregions is lower than the degree of overlap between the subregion and the other subregions before the adjustment.
11. The method according to any one of claims 1 to 7, characterized in that After identifying the target image through the target network model and obtaining target position information of the target area corresponding to the target image, the method further includes: Based on the region classification loss of the sub-region, the features of the sub-region are aligned with the features of other sub-regions.
12. The method according to any one of claims 1 to 7, characterized in that Before identifying the target image through the target network model to obtain target position information of the target area corresponding to the target image, the method further includes: The target network model is trained based on the loss of global features of the training samples, the loss of regional features, and the loss corresponding to the regional generation model.
13. A method for identifying an object, characterized in that: include: Acquire a target image including a pedestrian to be identified; The target image is identified by a target network model to obtain target position information of a target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is used to determine position information of sub-areas corresponding to a plurality of sub-images in the target image, the sub-image including at least one sub-part of the pedestrian, and the region perception model is used to determine target weights of the sub-areas, wherein the target weights are used to represent the importance of the sub-areas to the target area; re-identifying the pedestrian in the target image based on the target position information to obtain a re-identification result; The region generation model includes two cascaded fully connected layers, and the region generation model is used to predict the position information of the sub-region through the two cascaded fully connected layers. The region perception model includes a discriminability perception indicator and an invariance perception indicator. The region perception model is used to assign the target weight to the sub-region through the discriminability perception indicator and the invariance perception indicator, wherein the discriminability perception indicator is used to calculate the distinctive features of each sub-region through a self-attention mechanism, and obtain the first weight of the sub-region based on the distinctive features; the invariance perception indicator is used to compare the sub-region with the region corresponding to other images with the same identifier as the target image, obtain a comparison result, and determine the second weight of the sub-region based on the comparison result; determine the target weight based on the first weight and the second weight; wherein the target image is identified by the target network model to obtain the target position information of the target region corresponding to the target image, including: The target area corresponding to the feature map of the target image is identified by the target network model to obtain the target position information.
14. The method according to claim 13, wherein: Before identifying the target image through a target network model to obtain target position information of a target area corresponding to the target image, the method further includes: extracting the feature map of the target image.
15. A method for identifying an object, characterized in that: include: Displaying a target image including an object to be identified on a target interface; The re-identification result is displayed on the target interface, wherein the re-identification result is obtained by re-identifying the object in the target image based on the target position information of the target area, and the target position information is obtained by identifying the target image through a target network model. The target network model includes a region generation model and a region perception model. The region generation model is used to determine the position information of sub-regions corresponding to multiple sub-images in the target image, and the sub-image includes at least one sub-object of the object. The region perception model is used to determine the target weight of the sub-region, and the target weight is used to represent the importance of the sub-region to the target area; wherein the region generation model includes two cascaded fully connected layers, and the region generation model is used to predict the position information of the sub-region through the two cascaded fully connected layers, and the region perception model The model includes a discriminability perception indicator and an invariance perception indicator, and the region perception model is used to assign the target weight to the sub-region through the discriminability perception indicator and the invariance perception indicator, wherein the discriminability perception indicator is used to calculate the distinctive features of each sub-region through a self-attention mechanism, and obtain the first weight of the sub-region based on the distinctive features; the invariance perception indicator is used to compare the sub-region and the regions corresponding to other images with the same identifier as the target image to obtain a comparison result, and determine the second weight of the sub-region based on the comparison result; the target weight is determined based on the first weight and the second weight; wherein, identifying the target image through the target network model includes: identifying the target region corresponding to the feature map of the target image through the target network model.
16. A method for identifying an object, characterized in that: include: The front-end client uploads the target image including the object to be identified to the back-end server; The front-end client receives the re-identification result returned by the back-end server, wherein the re-identification result is obtained by the back-end server re-identifying the object in the target image based on the target position information of the target area, and the target position information is obtained by identifying the target image through a target network model, and the target network model includes a region generation model and a region perception model, and the region generation model is used to determine the position information of sub-regions corresponding to multiple sub-images in the target image, and the sub-image includes at least one sub-object of the object, and the region perception model is used to determine the target weight of the sub-region, and the target weight is used to represent the importance of the sub-region to the target area; wherein the region generation model includes two cascaded fully connected layers, and the region generation model is used to predict the position information of the sub-region through the two cascaded fully connected layers. Information, the region perception model includes a discriminability perception indicator and an invariance perception indicator, the region perception model is used to assign the target weight to the sub-region through the discriminability perception indicator and the invariance perception indicator, wherein the discriminability perception indicator is used to calculate the distinctive features of each of the sub-regions through a self-attention mechanism, and obtain the first weight of the sub-region based on the distinctive features; the invariance perception indicator is used to compare the sub-region and the region corresponding to other images with the same identifier as the target image, obtain a comparison result, and determine the second weight of the sub-region based on the comparison result; determine the target weight based on the first weight and the second weight; wherein, identifying the target image through the target network model includes: identifying the target region corresponding to the feature map of the target image through the target network model.
17. A method for identifying an object, characterized in that: include: Entering a target image including an object to be identified in an input interface of the target interface; sensing a position generation instruction within the target interface and displaying target position information of a target area corresponding to the target image, wherein the target position information is obtained by using position information of sub-areas corresponding to a plurality of sub-images in the target image and target weights of the sub-areas, the sub-image including at least one sub-object of the object, and the target weight being used to indicate the importance of the sub-area to the target area; sensing a recognition instruction in the target interface and displaying a re-recognition result, wherein the re-recognition result is obtained by re-recognizing the object in the target image based on the target position information; Wherein, the position information of the sub-regions respectively corresponding to the multiple sub-images in the target image is determined by the region generation model in the target network model, wherein the region generation model includes two cascaded fully connected layers, and the region generation model is used to predict the position information of the sub-regions through the two cascaded fully connected layers, and the target weights of the sub-regions respectively corresponding to the multiple sub-images in the target image are determined by the region perception model in the target network model, and the region perception model includes a discriminability perception indicator and an invariance perception indicator, and the region perception model is used to assign the sub-regions with the discriminability perception indicator and the invariance perception indicator. The target weight is determined, wherein the discriminability perception indicator is used to calculate the distinguishing features of each of the sub-regions through a self-attention mechanism, and obtain the first weight of the sub-region based on the distinguishing features; the invariance perception indicator is used to compare the sub-region and the region corresponding to other images with the same identification as the target image to obtain a comparison result, and determine the second weight of the sub-region based on the comparison result; the target weight is determined based on the first weight and the second weight; wherein the target network model is also used to identify the target region corresponding to the feature map of the target image to obtain the target position information of the target region.
18. An object recognition device, characterized in that: include: a first acquiring unit, configured to acquire a target image including an object to be identified; a first recognition unit, configured to recognize the target image through a target network model to obtain target position information of a target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is configured to determine position information of sub-areas corresponding to a plurality of sub-images in the target image, the sub-image including at least one sub-object of the object, and the region perception model is configured to determine a target weight of the sub-area, the target weight being configured to represent a degree of importance of the sub-area to the target area; a second recognition unit, configured to re-recognize the object in the target image based on the target position information to obtain a re-recognition result; In which, the region generation model includes two cascaded fully connected layers, and the region generation model is used to predict the position information of the sub-region through the two cascaded fully connected layers. The region perception model includes a discriminability perception indicator and an invariance perception indicator, and the region perception model is used to assign the target weight to the sub-region through the discriminability perception indicator and the invariance perception indicator, wherein the discriminability perception indicator is used to calculate the distinctive features of each sub-region through a self-attention mechanism, and obtain the first weight of the sub-region based on the distinctive features; the invariance perception indicator is used to compare the sub-region and the regions corresponding to other images with the same identifier as the target image, obtain a comparison result, and determine the second weight of the sub-region based on the comparison result; determine the target weight based on the first weight and the second weight; wherein the first recognition unit is also used to identify the target image through the following steps to obtain the target position information of the target region corresponding to the target image: identify the target region corresponding to the feature map of the target image through the target network model to obtain the target position information.
19. An object recognition device, characterized in that: include: a second acquiring unit, configured to acquire a target image including a pedestrian to be identified; a third recognition unit, configured to recognize the target image through a target network model to obtain target position information of a target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is configured to determine position information of sub-areas corresponding to a plurality of sub-images in the target image, the sub-image including at least one sub-part of the pedestrian, and the region perception model is configured to determine a target weight of the sub-area, the target weight being configured to represent the importance of the sub-area to the target area; a fourth recognition unit, configured to re-recognize the pedestrian in the target image based on the target position information to obtain a re-recognition result; In which, the region generation model includes two cascaded fully connected layers, and the region generation model is used to predict the position information of the sub-region through the two cascaded fully connected layers. The region perception model includes a discriminability perception indicator and an invariance perception indicator, and the region perception model is used to assign the target weight to the sub-region through the discriminability perception indicator and the invariance perception indicator, wherein the discriminability perception indicator is used to calculate the distinctive features of each sub-region through a self-attention mechanism, and obtain the first weight of the sub-region based on the distinctive features; the invariance perception indicator is used to compare the sub-region and the regions corresponding to other images with the same identifier as the target image, obtain a comparison result, and determine the second weight of the sub-region based on the comparison result; determine the target weight based on the first weight and the second weight; wherein the third recognition unit is also used to identify the target image through the following steps to obtain the target position information of the target region corresponding to the target image: identify the target region corresponding to the feature map of the target image through the target network model to obtain the target position information.
20. An object recognition device, characterized in that: include: a first display unit, configured to display a target image including an object to be identified on a target interface; a second display unit, configured to display a re-identification result on the target interface, wherein the re-identification result is obtained by re-identifying the object in the target image based on target position information of a target area, the target position information is obtained by identifying the target image through a target network model, the target network model includes a region generation model and a region perception model, the region generation model is configured to determine position information of sub-areas corresponding to a plurality of sub-images in the target image, the sub-image including at least one sub-object of the object, the region perception model is configured to determine a target weight of the sub-area, and the target weight is configured to indicate the importance of the sub-area to the target area; In which, the region generation model includes two cascaded fully connected layers, and the region generation model is used to predict the position information of the sub-region through the two cascaded fully connected layers. The region perception model includes a discriminability perception indicator and an invariance perception indicator, and the region perception model is used to assign the target weight to the sub-region through the discriminability perception indicator and the invariance perception indicator, wherein the discriminability perception indicator is used to calculate the distinctive features of each sub-region through a self-attention mechanism, and obtain the first weight of the sub-region based on the distinctive features; the invariance perception indicator is used to compare the sub-region and the region corresponding to other images with the same identifier as the target image to obtain a comparison result, and determine the second weight of the sub-region based on the comparison result; the target weight is determined based on the first weight and the second weight; wherein, identifying the target image through the target network model includes: identifying the target region corresponding to the feature map of the target image through the target network model.
21. An object recognition device, characterized in that: include: An uploading unit, configured to enable the front-end client to upload a target image including an object to be identified to the back-end server; a receiving unit, configured to enable the front-end client to receive a re-identification result returned by the back-end server, wherein the re-identification result is obtained by the back-end server re-identifying the object in the target image based on target position information of the target area, the target position information is obtained by identifying the target image through a target network model, the target network model includes a region generation model and a region perception model, the region generation model is used to determine position information of sub-areas corresponding to a plurality of sub-images in the target image, the sub-image includes at least one sub-object of the object, the region perception model is used to determine a target weight of the sub-area, and the target weight is used to represent the importance of the sub-area to the target area; In which, the region generation model includes two cascaded fully connected layers, and the region generation model is used to predict the position information of the sub-region through the two cascaded fully connected layers. The region perception model includes a discriminability perception indicator and an invariance perception indicator, and the region perception model is used to assign the target weight to the sub-region through the discriminability perception indicator and the invariance perception indicator, wherein the discriminability perception indicator is used to calculate the distinctive features of each sub-region through a self-attention mechanism, and obtain the first weight of the sub-region based on the distinctive features; the invariance perception indicator is used to compare the sub-region and the region corresponding to other images with the same identifier as the target image to obtain a comparison result, and determine the second weight of the sub-region based on the comparison result; the target weight is determined based on the first weight and the second weight; wherein, identifying the target image through the target network model includes: identifying the target region corresponding to the feature map of the target image through the target network model.
22. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored program, wherein when the program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 17.
23. A processor, characterized in that: The processor is configured to run a program, wherein the program executes the method according to any one of claims 1 to 17 when running.
24. An object recognition system, characterized in that: include: processor; A memory, connected to the processor, for providing the processor with instructions for processing the following processing steps: acquiring a target image including an object to be identified; identifying the target image through a target network model to obtain target position information of a target area corresponding to the target image, wherein the target network model includes a region generation model and a region perception model, the region generation model is used to determine the position information of sub-areas corresponding to a plurality of sub-images in the target image, the sub-image includes at least one sub-object of the object, the region perception model is used to determine the target weight of the sub-area, and the target weight is used to represent the importance of the sub-area to the target area; re-identifying the object in the target image based on the target position information to obtain a re-identification result; wherein the region generation model includes two cascaded fully connected layers, the region generation model is used to predict the position information of the sub-area through the two cascaded fully connected layers, The region perception model includes a discriminability perception indicator and an invariance perception indicator, and the region perception model is used to assign the target weight to the sub-region through the discriminability perception indicator and the invariance perception indicator, wherein the discriminability perception indicator is used to calculate the distinctive features of each sub-region through a self-attention mechanism, and obtain the first weight of the sub-region based on the distinctive features; the invariance perception indicator is used to compare the sub-region and the regions corresponding to other images with the same identifier as the target image to obtain a comparison result, and determine the second weight of the sub-region based on the comparison result; determine the target weight based on the first weight and the second weight; wherein, identifying the target image through the target network model to obtain the target position information of the target region corresponding to the target image includes: identifying the target region corresponding to the feature map of the target image through the target network model to obtain the target position information.
Citation Information
Patent Citations
Image processing method and device, terminal and storage medium
CN111739025A
Method and system for automatically capturing an object using a mobile terminal
US20140321752A1