Methods and devices for identifying fellow travelers

By constructing a peer recognition model using a self-optimizing clustering module and a graph attention network, the problem of high computational cost and low efficiency in existing technologies is solved, achieving efficient peer recognition.

CN116229509BActive Publication Date: 2026-05-26SHENZHEN XUMI YUNTU SPACE TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN XUMI YUNTU SPACE TECH CO LTD
Filing Date
2023-02-08
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing methods for identifying fellow travelers are computationally intensive, inefficient, and difficult to effectively capture fellow travelers.

Method used

An encoder is constructed using multiple fully connected layers, and a self-optimizing clustering module is built based on a clustering algorithm. By combining a graph attention network and an encoder, a pedestrian recognition model is trained using reconstruction loss function, mapping loss function, and clustering loss. Pedestrian relationship features and attribute features are extracted and input into the model for recognition.

Benefits of technology

It reduces the computational load for identifying fellow travelers, improves computational efficiency, and enables more effective identification of fellow travelers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116229509B_ABST
    Figure CN116229509B_ABST
Patent Text Reader

Abstract

This disclosure relates to the field of pedestrian recognition technology, and provides a method and apparatus for identifying people traveling together. The method includes: constructing an encoder using multiple fully connected layers; constructing a self-optimizing clustering module based on a clustering algorithm; constructing a people traveling together recognition model using a graph attention network, the encoder, and the self-optimizing clustering module; training the people traveling together recognition model using a reconstruction loss function, a mapping loss function, and a clustering loss; acquiring pedestrian images; extracting pedestrian relationship features and pedestrian attribute features from the pedestrian images; inputting the pedestrian relationship features and pedestrian attribute features into the trained people traveling together recognition model; and outputting the recognition result of whether the pedestrian in the pedestrian image is a person traveling together. By employing the above technical means, the problem of high computational load and low efficiency in existing people traveling together recognition methods is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of pedestrian recognition technology, and in particular to a method and apparatus for identifying pedestrians. Background Technology

[0002] Companion recognition algorithms are used to find people traveling together in a crowd. These algorithms have broad application prospects; for example, people often shop in groups, and the companions of individual shoppers are often potential customers. Finding these companions helps the mall's operations. However, because the paths of users in a mall are complex and the flow of people is frequent, it is generally difficult to effectively capture companions, resulting in a loss for those aiming to convert mall customers. Currently, some methods use facial recognition and calculate the temporal overlap of people's trajectories to search for companions. However, these methods are often computationally intensive, requiring a separate search of the entire feature space for each person, leading to low efficiency. Furthermore, this method, which queries companions at time intervals, often misses a lot of information, making it difficult to effectively identify companions.

[0003] In realizing the concept disclosed herein, the inventors discovered at least the following technical problems in the related technologies: existing methods for identifying fellow travelers have high computational load and low efficiency. Summary of the Invention

[0004] In view of this, the present disclosure provides a method, apparatus, electronic device, and computer-readable storage medium for identifying companions, in order to solve the problem of high computational load and low efficiency in existing companion identification methods.

[0005] A first aspect of this disclosure provides a method for identifying pedestrians, comprising: constructing an encoder using multiple fully connected layers, constructing a self-optimizing clustering module based on a clustering algorithm, and constructing a pedestrian identification model using a graph attention network, the encoder, and the self-optimizing clustering module; training the pedestrian identification model using a reconstruction loss function, a mapping loss function, and a clustering loss; acquiring pedestrian images, and extracting pedestrian relationship features and pedestrian attribute features from the pedestrian images; inputting the pedestrian relationship features and pedestrian attribute features into the trained pedestrian identification model, and outputting the identification result of whether the pedestrians in the pedestrian images are pedestrians traveling together.

[0006] A second aspect of this disclosure provides a pedestrian recognition device, comprising: a construction module configured to construct an encoder using multiple fully connected layers, construct a self-optimizing clustering module based on a clustering algorithm, and construct a pedestrian recognition model using a graph attention network, the encoder, and the self-optimizing clustering module; a training module configured to train the pedestrian recognition model using a reconstruction loss function, a mapping loss function, and a clustering loss; an extraction module configured to acquire pedestrian images and extract pedestrian relationship features and pedestrian attribute features from the pedestrian images; and a recognition module configured to input the pedestrian relationship features and pedestrian attribute features into the trained pedestrian recognition model and output a recognition result indicating whether a pedestrian in the pedestrian image is a pedestrian.

[0007] A third aspect of this disclosure provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described above.

[0008] A fourth aspect of this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.

[0009] The beneficial effects of this disclosed embodiment compared with the prior art are as follows: This disclosed embodiment constructs an encoder using multiple fully connected layers, builds a self-optimizing clustering module based on a clustering algorithm, and constructs a peer recognition model using a graph attention network, encoder, and self-optimizing clustering module; it trains the peer recognition model using a reconstruction loss function, a mapping loss function, and a clustering loss; it acquires pedestrian images and extracts pedestrian relationship features and pedestrian attribute features from the pedestrian images; it inputs the pedestrian relationship features and pedestrian attribute features into the trained peer recognition model and outputs the recognition result of whether the pedestrian in the pedestrian image is a peer. Therefore, by adopting the above technical means, the problem of high computational load and low efficiency in existing peer recognition methods can be solved, thereby reducing the computational load of peer recognition and improving computational efficiency. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a schematic diagram illustrating an application scenario of an embodiment of this disclosure;

[0012] Figure 2This is a flowchart illustrating a method for identifying companions provided in an embodiment of this disclosure;

[0013] Figure 3 This is a schematic diagram of the structure of a companion identification device provided in an embodiment of this disclosure;

[0014] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0015] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, so as to provide a thorough understanding of the embodiments of this disclosure. However, those skilled in the art will understand that this disclosure may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this disclosure with unnecessary detail.

[0016] A method and apparatus for identifying companions according to embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings.

[0017] Figure 1 This is a schematic diagram illustrating an application scenario of an embodiment of this disclosure. The application scenario may include terminal devices 101, 102, and 103, server 104, and network 105.

[0018] Terminal devices 101, 102, and 103 can be hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices with displays that support communication with server 104, including but not limited to smartphones, tablets, laptops, and desktop computers. When terminal devices 101, 102, and 103 are software, they can be installed in the aforementioned electronic devices. Terminal devices 101, 102, and 103 can be implemented as multiple software programs or software modules, or as a single software program or software module; this disclosure does not impose any limitations on this. Furthermore, various applications can be installed on terminal devices 101, 102, and 103, such as data processing applications, instant messaging tools, social platform software, search applications, shopping applications, etc.

[0019] Server 104 can be a server that provides various services, such as a backend server that receives requests sent by terminal devices with which it has established communication connections. This backend server can receive and analyze the requests sent by the terminal devices and generate processing results. Server 104 can be a single server, a server cluster consisting of several servers, or a cloud computing service center. This embodiment of the disclosure does not impose any limitations on these aspects.

[0020] It should be noted that server 104 can be either hardware or software. When server 104 is hardware, it can be various electronic devices that provide various services to terminal devices 101, 102, and 103. When server 104 is software, it can be multiple software programs or software modules that provide various services to terminal devices 101, 102, and 103, or it can be a single software program or software module that provides various services to terminal devices 101, 102, and 103. This disclosure does not limit the scope of the embodiments.

[0021] Network 105 can be a wired network using coaxial cable, twisted pair, and fiber optic connection, or it can be a wireless network that enables interconnection of various communication devices without wiring, such as Bluetooth, Near Field Communication (NFC), Infrared, etc. This disclosure does not limit the scope of the network.

[0022] Users can establish a communication connection with server 104 via network 105 through terminal devices 101, 102, and 103 to receive or send information, etc. It should be noted that the specific types, quantities, and combinations of terminal devices 101, 102, and 103, server 104, and network 105 can be adjusted according to the actual needs of the application scenario, and this disclosure embodiment does not impose any limitations on this.

[0023] Figure 2 This is a flowchart illustrating a method for identifying fellow travelers provided in an embodiment of this disclosure. Figure 2 The method for identifying companions can be derived from Figure 1 The computer or server, or the software on the computer or server, executes the command. For example... Figure 2 As shown, the method for identifying fellow travelers includes:

[0024] S201 utilizes multiple fully connected layers to construct an encoder, constructs a self-optimizing clustering module based on a clustering algorithm, and constructs a peer recognition model using a graph attention network, encoder, and self-optimizing clustering module.

[0025] S202, using reconstruction loss function, mapping loss function and clustering loss to complete the training of the peer recognition model;

[0026] S203, Obtain pedestrian images, and extract pedestrian relationship features and pedestrian attribute features from the pedestrian images;

[0027] S204: Input the pedestrian relationship features and pedestrian attribute features into the trained pedestrian recognition model, and output the recognition result of whether the pedestrian in the pedestrian image is a fellow pedestrian.

[0028] Pedestrian images can be multiple images of a target pedestrian, and each image may also contain other pedestrians besides the target pedestrian. Pedestrians can be considered nodes; if two pedestrians are walking together, a relationship exists between them, and an edge exists between their nodes. The existence of an edge between any two pedestrians represents the pedestrian relationship feature. Extracting pedestrian relationship features from pedestrian images can be achieved using graph theory algorithms for extracting nodes and edges, such as Prim's algorithm. Pedestrian attribute features include information such as age, gender, and clothing. Extracting pedestrian attribute features from pedestrian images can be achieved by training a neural network model.

[0029] For example, in a shopping mall setting, all pedestrian images (or videos) of customer A can be obtained from the surveillance system. Pedestrian relationship features and pedestrian attribute features are extracted from these images. Based on these features, a companion recognition model is used to identify customer A's companions. It's worth noting that, for instance, after finding customer B, who is related to customer A, we can then find customer B's companions. In short, pedestrian relationship features are the characteristics between every two pedestrians. If customer A's group consists of 10 people, then every two people in that group will have a pedestrian relationship feature.

[0030] According to the technical solution provided in this disclosure, an encoder is constructed using multiple fully connected layers, a self-optimizing clustering module is constructed based on a clustering algorithm, and a peer recognition model is constructed using a graph attention network, an encoder, and a self-optimizing clustering module. The peer recognition model is trained using a reconstruction loss function, a mapping loss function, and a clustering loss. Pedestrian images are acquired, and pedestrian relationship features and pedestrian attribute features are extracted from the pedestrian images. The pedestrian relationship features and pedestrian attribute features are input into the trained peer recognition model, and the recognition result of whether the pedestrian in the pedestrian image is a peer is output. Therefore, by adopting the above technical means, the problem of high computational load and low efficiency of existing peer recognition methods can be solved, thereby reducing the computational load of peer recognition and improving computational efficiency.

[0031] A peer recognition model is constructed using a graph attention network, an encoder, and a self-optimizing clustering module. The model consists of a graph attention network and an encoder connected in parallel and then connected to a self-optimizing clustering module.

[0032] The outputs of the graph attention network and encoder are both input to the self-optimizing clustering module. In addition to the graph attention network, encoder, and self-optimizing clustering module, other networks can be added inside the person-to-person recognition model, such as multiple fully connected layers connected after the self-optimizing clustering module.

[0033] The training of the peer recognition model is completed using reconstruction loss function, mapping loss function, and clustering loss, including: the first stage of training the peer recognition model: training the graph attention network using reconstruction loss function, training the encoder using mapping loss function, and training the self-optimizing clustering module using clustering loss; the second stage of training the peer recognition model: adding the reconstruction loss function, mapping loss function, and clustering loss according to preset weights to obtain the total loss function, and using the total loss function to train the peer recognition model as a whole.

[0034] Reconstruction loss function L r1

[0035]

[0036] A represents the characteristics of pedestrian relationships. A represents the output of the graph attention network. ij This represents the pedestrian relationship feature between the i-th and j-th pedestrians. Let represent the pedestrian relationship features of the i-th and j-th pedestrians output by the graph attention network, n represent the total number of pedestrians, and loss can be any loss function, such as the cross-entropy loss function.

[0037] Clustering loss can be achieved using the KL divergence algorithm. KL (Kullback-Leibler Divergence), also known as relative entropy, is used to measure the degree of difference between two probability distributions, specifically the degree of difference between clustering features and merging features.

[0038] The encoder is trained using a mapping loss function, which includes: constructing a decoder corresponding to the encoder using multiple fully connected layers and deconvolutional layers; decoding the encoder output using the decoder to obtain the decoding result; calculating the loss value between the encoder input and the decoding result using the mapping loss function; updating the model parameters of the encoder and decoder based on the loss value to complete the training of the encoder and decoder; after training, removing the decoder and keeping only the encoder.

[0039] Mapping loss function L r2

[0040]

[0041] G w′ Indicates decoder, F w Indicates encoder, m i It is the i-th input of the encoder, F w (m i ) indicates when the input is m i The output of the time encoder, m iThe pedestrian relationship features and pedestrian attribute features of the i-th pedestrian are related, where n represents the total number of inputs, and G w′ (F w (m i )) indicates that the decoder is set to work when the input is m i The decoding of the encoder output, that is, the decoding result, |||| 2 Represents two-dimensional norm operations.

[0042] The pedestrian relationship features and pedestrian attribute features are input into a trained pedestrian recognition model, and the output is the recognition result of whether the pedestrian in the pedestrian image is a fellow traveler. This includes: processing the pedestrian relationship features and pedestrian attribute features using a graph attention network to obtain reconstructed pedestrian relationship features; processing the pedestrian relationship features and pedestrian attribute features using an encoder to obtain low-dimensional embedding features; processing the reconstructed pedestrian relationship features and low-dimensional embedding features using a self-optimizing clustering module to obtain clustering features; and determining whether the pedestrian in the pedestrian image is a fellow traveler based on the clustering features.

[0043] Graph Attention Network (GAT) is used to reconstruct pedestrian relationship features based on pedestrian attribute features. The reconstructed pedestrian relationship features can simultaneously express pedestrian relationship features and pedestrian attribute features. The encoder is used to map pedestrian relationship features and pedestrian attribute features to a low dimension to obtain low-dimensional embedding features. Alternatively, pedestrian relationship features and pedestrian attribute features can be merged to obtain merged features, and then the merged features can be mapped to a low dimension to obtain low-dimensional embedding features.

[0044] The reconstructed pedestrian relationship features and low-dimensional embedding features are processed using a self-optimizing clustering module to obtain clustering features, including: merging the reconstructed pedestrian relationship features and low-dimensional embedding features to obtain merged features; and performing clustering processing on the merged features to obtain merged features.

[0045] Clustering can be performed using the k-means algorithm.

[0046] The pedestrian recognition model mentioned above does not directly process pedestrian images. To directly process pedestrian images, we can: construct a graph structure module based on graph structure algorithms and construct a person attribute model. The graph structure module is used to extract pedestrian relationship features from pedestrian images, and the person attribute model is used to extract pedestrian attribute features from pedestrian images. The pedestrian recognition model is constructed using the graph structure module, person attribute model, graph attention network, encoder, and self-optimizing clustering module.

[0047] Graph structure algorithms can be Prim's algorithm, which constructs a character attribute model by training a neural network model to extract task attribute information.

[0048] The graph structure module and the person attribute model run in parallel. The outputs of the graph structure module and the person attribute model are concatenated and then input into the graph attention network and the encoder. The graph attention network and the encoder run in parallel and are then connected to the self-optimizing clustering module to obtain the peer recognition model.

[0049] According to the technical solution provided in this disclosure, a graph structure module is constructed based on a graph structure algorithm to build a person attribute model. The graph structure module is used to extract pedestrian relationship features from pedestrian images, and the person attribute model is used to extract pedestrian attribute features from pedestrian images. An encoder is constructed using multiple fully connected layers, and a self-optimizing clustering module is constructed based on a clustering algorithm. A peer recognition model is constructed using a graph attention network, the encoder, and the self-optimizing clustering module. The peer recognition model is trained using a reconstruction loss function, a mapping loss function, and a clustering loss. Pedestrian images are acquired, input into the trained peer recognition model, and the model outputs the recognition result of whether the pedestrian in the image is a peer. Therefore, by adopting the above technical means, the problem of high computational load and low efficiency in existing peer recognition methods can be solved, thereby reducing the computational load of peer recognition and improving computational efficiency.

[0050] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.

[0051] The following are embodiments of the apparatus disclosed herein, which can be used to execute embodiments of the method disclosed herein. For details not disclosed in the apparatus embodiments of this disclosure, please refer to the embodiments of the method disclosed herein.

[0052] Figure 3 This is a schematic diagram of a companion identification device provided in an embodiment of this disclosure. Figure 3 As shown, the companion identification device includes:

[0053] Module 301 is configured to build an encoder using multiple fully connected layers, build a self-optimizing clustering module based on a clustering algorithm, and build a peer recognition model using a graph attention network, an encoder, and a self-optimizing clustering module.

[0054] Training module 302 is configured to train the peer recognition model using reconstruction loss function, mapping loss function and clustering loss;

[0055] The extraction module 303 is configured to acquire pedestrian images and extract pedestrian relationship features and pedestrian attribute features from the pedestrian images;

[0056] The recognition module 304 is configured to input pedestrian relationship features and pedestrian attribute features into a trained pedestrian recognition model and output the recognition result of whether the pedestrian in the pedestrian image is a fellow pedestrian.

[0057] Pedestrian images can be multiple images of a target pedestrian, and each image may also contain other pedestrians besides the target pedestrian. Pedestrians can be considered nodes; if two pedestrians are walking together, a relationship exists between them, and an edge exists between their nodes. The existence of an edge between any two pedestrians represents the pedestrian relationship feature. Extracting pedestrian relationship features from pedestrian images can be achieved using graph theory algorithms for extracting nodes and edges, such as Prim's algorithm. Pedestrian attribute features include information such as age, gender, and clothing. Extracting pedestrian attribute features from pedestrian images can be achieved by training a neural network model.

[0058] For example, in a shopping mall setting, all pedestrian images (or videos) of customer A can be obtained from the surveillance system. Pedestrian relationship features and pedestrian attribute features are extracted from these images. Based on these features, a companion recognition model is used to identify customer A's companions. It's worth noting that, for instance, after finding customer B, who is related to customer A, we can then find customer B's companions. In short, pedestrian relationship features are the characteristics between every two pedestrians. If customer A's group consists of 10 people, then every two people in that group will have a pedestrian relationship feature.

[0059] According to the technical solution provided in this disclosure, an encoder is constructed using multiple fully connected layers, a self-optimizing clustering module is constructed based on a clustering algorithm, and a peer recognition model is constructed using a graph attention network, an encoder, and a self-optimizing clustering module. The peer recognition model is trained using a reconstruction loss function, a mapping loss function, and a clustering loss. Pedestrian images are acquired, and pedestrian relationship features and pedestrian attribute features are extracted from the pedestrian images. The pedestrian relationship features and pedestrian attribute features are input into the trained peer recognition model, and the recognition result of whether the pedestrian in the pedestrian image is a peer is output. Therefore, by adopting the above technical means, the problem of high computational load and low efficiency of existing peer recognition methods can be solved, thereby reducing the computational load of peer recognition and improving computational efficiency.

[0060] Optionally, the building module 301 is also configured to connect a graph attention network and an encoder in parallel to a self-optimizing clustering module to obtain a peer recognition model.

[0061] The outputs of the graph attention network and encoder are both input to the self-optimizing clustering module. In addition to the graph attention network, encoder, and self-optimizing clustering module, other networks can be added inside the person-to-person recognition model, such as multiple fully connected layers connected after the self-optimizing clustering module.

[0062] Optionally, the training module 302 is also configured to perform a first-stage training on the peer recognition model: training the graph attention network using the reconstruction loss function, training the encoder using the mapping loss function, and training the self-optimizing clustering module using the clustering loss; and a second-stage training on the peer recognition model: adding the reconstruction loss function, the mapping loss function, and the clustering loss according to preset weights to obtain the total loss function, and using the total loss function to train the peer recognition model as a whole.

[0063] Reconstruction loss function L r1

[0064]

[0065] A represents the characteristics of pedestrian relationships. A represents the output of the graph attention network. ij This represents the pedestrian relationship feature between the i-th and j-th pedestrians. Let represent the pedestrian relationship features of the i-th and j-th pedestrians output by the graph attention network, n represent the total number of pedestrians, and loss can be any loss function, such as the cross-entropy loss function.

[0066] Clustering loss can be achieved using the KL divergence algorithm. KL (Kullback-Leibler Divergence), also known as relative entropy, is used to measure the degree of difference between two probability distributions, specifically the degree of difference between clustering features and merging features.

[0067] Optionally, the training module 302 is further configured to construct a decoder corresponding to the encoder using multiple fully connected layers and deconvolutional layers; use the decoder to decode the output of the encoder to obtain the decoding result; use the mapping loss function to calculate the loss value between the input of the encoder and the decoding result; update the model parameters of the encoder and decoder according to the loss value to complete the training of the encoder and decoder; after training, remove the decoder and keep only the encoder.

[0068] Mapping loss function L r2

[0069]

[0070] G w′ Indicates decoder, F w Indicates encoder, m i It is the i-th input of the encoder, F w (m i ) indicates when the input is m i The output of the time encoder, m i The pedestrian relationship features and pedestrian attribute features of the i-th pedestrian are related, where n represents the total number of inputs, and G w′ (Fw (m i )) indicates that the decoder is set to work when the input is m i The decoding of the encoder output, that is, the decoding result, |||| 2 Represents two-dimensional norm operations.

[0071] Optionally, the recognition module 304 is further configured to process the pedestrian relationship features and pedestrian attribute features using a graph attention network to obtain reconstructed pedestrian relationship features; process the pedestrian relationship features and pedestrian attribute features using an encoder to obtain low-dimensional embedding features; process the reconstructed pedestrian relationship features and low-dimensional embedding features using a self-optimizing clustering module to obtain clustering features; and determine whether the pedestrians in the pedestrian image are fellow pedestrians based on the clustering features.

[0072] Graph Attention Network (GAT) is used to reconstruct pedestrian relationship features based on pedestrian attribute features. The reconstructed pedestrian relationship features can simultaneously express pedestrian relationship features and pedestrian attribute features. The encoder is used to map pedestrian relationship features and pedestrian attribute features to a low dimension to obtain low-dimensional embedding features. Alternatively, pedestrian relationship features and pedestrian attribute features can be merged to obtain merged features, and then the merged features can be mapped to a low dimension to obtain low-dimensional embedding features.

[0073] Optionally, the recognition module 304 is also configured to merge the reconstructed pedestrian relationship features and low-dimensional embedding features to obtain merged features; and to perform clustering processing on the merged features to obtain merged features.

[0074] Clustering can be performed using the k-means algorithm.

[0075] Optionally, the construction module 301 is further configured to construct a graph structure module based on a graph structure algorithm, and to construct a person attribute model. The graph structure module is used to extract pedestrian relationship features from pedestrian images, and the person attribute model is used to extract pedestrian attribute features from pedestrian images. A pedestrian recognition model is constructed using the graph structure module, the person attribute model, a graph attention network, an encoder, and a self-optimizing clustering module.

[0076] The graph structure module and the person attribute model run in parallel. The outputs of the graph structure module and the person attribute model are concatenated and then input into the graph attention network and the encoder. The graph attention network and the encoder run in parallel and are then connected to the self-optimizing clustering module to obtain the peer recognition model.

[0077] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this disclosure.

[0078] Figure 4This is a schematic diagram of the electronic device 4 provided in an embodiment of this disclosure. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the computer program 403, it implements the steps in the various method embodiments described above. Alternatively, when the processor 401 executes the computer program 403, it implements the functions of each module / unit in the various device embodiments described above.

[0079] Electronic device 4 can be a desktop computer, laptop, handheld computer, cloud server, or other electronic device. Electronic device 4 may include, but is not limited to, processor 401 and memory 402. Those skilled in the art will understand that... Figure 4 This is merely an example of electronic device 4 and does not constitute a limitation on electronic device 4. It may include more or fewer components than shown, or different components.

[0080] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0081] The memory 402 can be an internal storage unit of the electronic device 4, such as a hard disk or RAM of the electronic device 4. The memory 402 can also be an external storage device of the electronic device 4, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc., equipped on the electronic device 4. The memory 402 can also include both internal and external storage units of the electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device.

[0082] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0083] If an integrated module / unit is implemented as 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, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program may include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in a computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in a jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0084] The above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit it. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be included within the protection scope of this disclosure.

Claims

1. A method for identifying fellow travelers, characterized in that, include: An encoder is constructed using multiple fully connected layers, a self-optimizing clustering module is constructed based on a clustering algorithm, and a peer recognition model is constructed using a graph attention network, the encoder, and the self-optimizing clustering module. The peer recognition model is trained using reconstruction loss function, mapping loss function, and clustering loss. Obtain pedestrian images, and extract pedestrian relationship features and pedestrian attribute features from the pedestrian images; Input the pedestrian relationship features and the pedestrian attribute features into the trained pedestrian recognition model, and output the recognition result of whether the pedestrian in the pedestrian image is a fellow pedestrian; The pedestrian relationship features and pedestrian attribute features are input into the trained pedestrian recognition model, and the model outputs the recognition result of whether the pedestrian in the pedestrian image is a fellow pedestrian, including: The pedestrian relationship features and pedestrian attribute features are processed using the graph attention network to obtain the reconstructed pedestrian relationship features; The encoder is used to process the pedestrian relationship features and the pedestrian attribute features to obtain low-dimensional embedding features; The self-optimizing clustering module is used to process the reconstructed pedestrian relationship features and the low-dimensional embedding features to obtain clustering features; The identification result of determining whether the pedestrian in the pedestrian image is a fellow traveler is determined based on the clustering features.

2. The method according to claim 1, characterized in that, A peer recognition model is constructed using a graph attention network, the encoder, and the self-optimizing clustering module, including: The graph attention network and the encoder are connected in parallel to the self-optimizing clustering module to obtain the peer recognition model.

3. The method according to claim 1, characterized in that, The training of the peer recognition model is completed using reconstruction loss function, mapping loss function, and clustering loss, including: The first stage of training for the peer recognition model involves: training the graph attention network using the reconstruction loss function, training the encoder using the mapping loss function, and training the self-optimizing clustering module using the clustering loss. The second stage of training is performed on the peer recognition model: the reconstruction loss function, the mapping loss function, and the clustering loss are added together according to preset weights to obtain the total loss function, and the peer recognition model is trained as a whole using the total loss function.

4. The method according to claim 1, characterized in that, Training the encoder using the mapping loss function includes: The decoder corresponding to the encoder is constructed using multiple fully connected layers and deconvolutional layers; The decoder is used to decode the output of the encoder to obtain the decoding result. The loss value between the encoder input and the decoding result is calculated using the mapping loss function. The model parameters of the encoder and the decoder are updated based on the loss value to complete the training of the encoder and the decoder. After training, the decoder is removed and only the encoder is retained.

5. The method according to claim 1, characterized in that, The self-optimizing clustering module is used to process the reconstructed pedestrian relationship features and the low-dimensional embedding features to obtain clustering features, including: The reconstructed pedestrian relationship features and the low-dimensional embedding features are merged to obtain the merged features; The merged features are obtained by performing clustering processing on the merged features.

6. The method according to claim 1, characterized in that, include: A graph structure module is constructed based on a graph structure algorithm to build a person attribute model. The graph structure module is used to extract pedestrian relationship features from the pedestrian images, and the person attribute model is used to extract pedestrian attribute features from the pedestrian images. The peer recognition model is constructed using the graph structure module, the person attribute model, the graph attention network, the encoder, and the self-optimizing clustering module.

7. A companion identification device, characterized in that, include: The construction module is configured to build an encoder using multiple fully connected layers, build a self-optimizing clustering module based on a clustering algorithm, and build a peer recognition model using a graph attention network, the encoder, and the self-optimizing clustering module. The training module is configured to train the peer recognition model using a reconstruction loss function, a mapping loss function, and a clustering loss. The extraction module is configured to acquire pedestrian images and extract pedestrian relationship features and pedestrian attribute features from the pedestrian images; The recognition module is configured to input the pedestrian relationship features and the pedestrian attribute features into a trained pedestrian recognition model, and output the recognition result of whether the pedestrian in the pedestrian image is a fellow pedestrian; The recognition module is specifically configured to: process the pedestrian relationship features and pedestrian attribute features using the graph attention network to obtain reconstructed pedestrian relationship features; process the pedestrian relationship features and pedestrian attribute features using the encoder to obtain low-dimensional embedding features; and process the reconstructed pedestrian relationship features and low-dimensional embedding features using the self-optimizing clustering module to obtain clustering features. The identification result of determining whether the pedestrian in the pedestrian image is a fellow traveler is determined based on the clustering features.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.