Crowd counting method and related equipment

By combining WIFI detection request frames and video stream data in the crowd counting server, the number of people in the perception area with neural network model predicts the number of people in the existing technology, and the accurate prediction of crowds and the effective determination of the total number of crowds have been realized. Essence

CN118015540BActive Publication Date: 2025-01-28北京数原数字化城市研究中心
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410145203.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-01
Publication Date
2025-01-28
Estimated Expiration
2044-02-01

AI Technical Summary

Technical Problem

In the prior art, it is difficult to determine the number of people in the perception area based on the WiFi detection request frame, resulting in difficulty in counting people.

Method used

By connecting the communication connection with the wireless network detector AP and the camera in the crowd counting server, using the training set training neural network model, combining the detection request frame and video stream data, the number of people in each perception area is predicted, and the total number of crowds are summarized.

Benefits of technology

The accurate prediction of the number of people in the perception area and the effective determination of the total number of crowds have been implemented, and the problems of the number of crowds in existing technologies are solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118015540B_ABST
    Figure CN118015540B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a crowd counting method, device, electronic device and readable storage medium, which relates to the field of wireless communication technology. The trained neural network model is trained by using a training set to obtain a trained neural network model. The training set includes a plurality of training sample pairs of different time periods. The training sample pairs include a first input vector determined based on a detection request frame corresponding to a first perception area and a visual true value determined based on a video stream. The second input vector corresponding to each perception area is respectively input into the trained neural network model to obtain the number of people corresponding to each perception area. Thus, the trained neural network model is first obtained according to the detection request frame of the first perception area and the visual true value of the first perception area, and then the trained neural network model and the detection request frame of each perception area are used to obtain the number of people corresponding to each perception area and thus the total number of people.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of wireless communication technology, and in particular to a crowd counting method and related equipment. Background Art

[0002] Crowd counting is an active research area currently involving a variety of techniques and methods for real-time monitoring and estimating the number of people in a space.

[0003] Crowd counting using wireless LAN technology (Wireless Fidelity, WiFi) is a relatively common counting method. However, since the hardware address in the WiFi detection request frame is randomized, it is impossible to form a one-to-one correspondence between the user crowd and the hardware address of the mobile device. Therefore, it is impossible to directly determine the number of people in each sensing area based on the hardware address to achieve crowd counting.

[0004] It can be seen that in the prior art, there is a problem that it is difficult to determine the number of people in the sensing area based on the WiFi detection request frame. Summary of the invention

[0005] The embodiments of the present application provide a crowd counting method and related devices to solve the problem in the prior art that it is difficult to determine the number of people in a sensing area based on a WiFi detection request frame.

[0006] In a first aspect, an embodiment of the present application provides a crowd counting method, which is applied to a crowd counting server, wherein the crowd counting server is connected to N wireless network detectors AP and cameras, each of which corresponds to a sensing area, N is an integer greater than 1, and the AP is used to monitor detection request frames of wireless devices, and the camera corresponds to a first sensing area, which is any of the sensing areas, and the camera is used to obtain a video stream of the first sensing area. The method includes:

[0007] Training a neural network model using a training set to obtain a trained neural network model, wherein the training set includes a plurality of training sample pairs at different time periods, wherein the training sample pairs include a first input vector determined based on a detection request frame corresponding to the first perception area and a visual truth value determined based on the video stream;

[0008] Inputting the second input vector corresponding to each of the sensing areas into the trained neural network model respectively to obtain the number of people corresponding to each sensing area, wherein the second input vector is determined based on the corresponding detection request frame of the sensing area;

[0009] The total number of people is determined according to the number of people corresponding to each of the sensing areas.

[0010] In a second aspect, an embodiment of the present application further provides a crowd counting device, which is applied to a crowd counting server, wherein the crowd counting server is connected to N wireless network detectors AP and cameras, each of which corresponds to a sensing area, N is an integer greater than 1, and the AP is used to monitor the detection request frame of the wireless device, and the camera corresponds to a first sensing area, which is any of the sensing areas, and the camera is used to obtain a video stream of the first sensing area, and the device includes:

[0011] A first training module is used to train the neural network model using a training set to obtain a trained neural network model, wherein the training set includes a plurality of training sample pairs in different time periods, and the training sample pairs include a first input vector determined based on a detection request frame corresponding to the first perception area and a visual truth value determined based on the video stream;

[0012] A first obtaining module, configured to input a second input vector corresponding to each of the sensing areas into the trained neural network model to obtain a number of people corresponding to each sensing area, wherein the second input vector is determined based on a detection request frame corresponding to the sensing area;

[0013] The determination module is used to determine the total number of people according to the number of people corresponding to each of the sensing areas.

[0014] In a third aspect, an embodiment of the present application provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0015] In a fourth aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0016] In a fifth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0017] In an embodiment of the present application, a trained neural network model is obtained by training a neural network model using a training set, wherein the training set includes a plurality of training sample pairs of different time periods, wherein the training sample pairs include a first input vector determined based on a detection request frame corresponding to the first perception area and a visual truth value determined based on the video stream; a second input vector corresponding to each of the perception areas is respectively input into the trained neural network model to obtain the number of people corresponding to each perception area, wherein the second input vector is determined based on the detection request frame corresponding to the perception area; and the total number of people is determined based on the number of people corresponding to each of the perception areas. In this way, a trained neural network model can be obtained first based on the detection request frame of the first perception area and the visual truth value of the first perception area, and then the trained neural network model and the detection request frame of each perception area are used to obtain the number of people corresponding to each perception area and thus the total number of people. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0019] Figure 1 It is a flow chart of a crowd counting method provided in an embodiment of the present application;

[0020] Figure 2 It is a schematic diagram of the training and derivation process of the neural network model provided by this application;

[0021] Figure 3 It is a schematic diagram of the neural network model prediction process provided in the embodiment of the present application;

[0022] Figure 4 It is a schematic diagram of a method for extracting randomness in a probe request frame provided by an embodiment of the present application;

[0023] Figure 5 It is a structural schematic diagram of a crowd counting system based on WiFi provided by an embodiment of the present application;

[0024] Figure 6 is a schematic diagram of the structure of a crowd counting device provided in an embodiment of the present application;

[0025] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0027] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the structures used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0028] like Figure 1 As shown, an embodiment of the present application provides a crowd counting method, which is applied to a crowd counting server, wherein the crowd counting server is connected to N wireless network detectors APs and cameras, each of which corresponds to a sensing area, N is an integer greater than 1, and the AP is used to monitor detection request frames of wireless devices. The camera corresponds to a first sensing area, which is any of the sensing areas. The camera is used to obtain a video stream of the first sensing area, including the following steps:

[0029] Step 101, training a neural network model using a training set to obtain a trained neural network model, wherein the training set includes a plurality of training sample pairs in different time periods, and the training sample pairs include a first input vector determined based on a detection request frame corresponding to the first perception area and a visual true value determined based on the video stream;

[0030] It should be noted that the trained neural network model is a neural network model with a prediction accuracy greater than a preset value. Exemplarily, the preset value may be 98.5%.

[0031] Furthermore, the above prediction accuracy can be understood as the loss function of the trained neural network model, and the loss function of the trained neural network model is calculated as the ratio of the output value of the neural network model to the visual true value at the corresponding moment;

[0032] Specifically, the process of training a neural network model using a training set is as follows: using training samples from multiple different time periods in the training set, the first input vectors in the training samples from different time periods are input into the neural network model for training in chronological order. After each first input vector is input into the neural network model for training, the output value of the neural network model is compared with the visual true value in the training samples of the corresponding time period to obtain a ratio, which is the loss function; then determine whether the loss function satisfies a preset value or not. If it is greater than or equal to the preset value, the current neural network model is determined as the trained neural network model.

[0033] For example, the training set includes: the first input vector A and the visual truth value B in the first period; the first input vector C and the visual truth value D in the second period; and the first input vector E and the visual truth value F at the third moment.

[0034] For another example, A is input into the neural network model, and then the output value of the neural network model at this time is compared with B, and the obtained ratio is compared with the preset value. If the ratio is greater than the preset value, the neural network model at this time is determined as the trained neural network model; if the ratio is less than the preset value, the neural network model will continue to be trained using the above C, and the same operation is performed as above, which will not be repeated here.

[0035] It should be understood that the first input vector determined based on the detection request frame corresponding to the first sensing area can be understood as being determined by parsing the detection request frame to obtain the corresponding timestamp, signal strength, and random hardware address (Media Access Control, MAC). Furthermore, the first input vector is constructed based on the number of MAC addresses received on each AP per unit time.

[0036] Exemplarily, when the unit time is one minute, the number of MACs on each AP is counted every 6 seconds; then within one minute, there are a total of 10 MAC number values ​​on each AP, and the mean μ and standard deviation σ are calculated based on these 10 MAC number values. These 12 values ​​constitute a vector, which is the first input vector.

[0037] like Figure 2 and Figure 3 As shown, Figure 2 is a schematic diagram of the training and reasoning process of the neural network model provided in the embodiment of the present application, Figure 3 It is a schematic diagram of the neural network model prediction process provided in the embodiment of the present application.

[0038] Specifically, taking AP6 as an example, the neural network model is trained, and the first input vector constructed by AP6 within one minute is input into the neural network model for training, and the unit time of one minute is divided into 10 small intervals. The first input vector of AP6 within this minute includes: the MAC number of AP6 at the 06th second; the MAC number of AP6 at the 12th second; the MAC number of AP6 at the 18th second; the MAC number of AP6 at the 24th second; the MAC number of AP6 at the 30th second; the MAC number of AP6 at the 36th second; the MAC number of AP6 at the 42nd second; the MAC number of AP6 at the 48th second; the MAC number of AP6 at the 54th second; the MAC number of AP6 at the 60th second; the MAC mean of AP6 within this minute; and the MAC standard deviation of AP6 within this minute.

[0039] Subsequently, in chronological order, the first input vector corresponding to AP6 at each minute is input into the neural network model for training.

[0040] In addition, no further restrictions are imposed on the length of the unit time and the number of small intervals into which the unit time is divided.

[0041] It should be noted that, optionally, the MAC quantity values ​​in the training samples in the training set are normalized.

[0042] Optionally, the hidden layers of the neural network model all use a sigmoid excitation function, and the output layer uses a linear excitation function; MSE is used as the loss function of the neural network; and the Adam optimization algorithm is used for solving.

[0043] Step 102, inputting the second input vector corresponding to each of the sensing areas into the trained neural network model to obtain the number of people corresponding to each sensing area, wherein the second input vector is determined based on the corresponding detection request frame of the sensing area;

[0044] In step 102, the second input vector determined based on the detection request frame corresponding to the sensing area can be understood as being determined based on the detection request frame, and the detection request frame is parsed to obtain the corresponding timestamp, signal strength, and random hardware address (Media Access Control, MAC). Further, the second input vector is constructed based on the number of MAC addresses received on each AP per unit time.

[0045] Exemplarily, when the unit time is one minute, the number of MACs on each AP is counted every 6 seconds; then within one minute, there are a total of 10 MAC number values ​​on each AP, and the mean μ and standard deviation σ are calculated based on these 10 MAC number values. These 12 values ​​constitute a vector, which is the second input vector.

[0046] The construction method of the second input vector of each AP in each unit time refers to the construction method of the first input vector, which will not be repeated here.

[0047] Step 103: determining the total number of people according to the number of people corresponding to each of the sensing areas.

[0048] In step 103, after obtaining the number of people corresponding to each of the sensing areas, the number of people corresponding to all the sensing areas is added together to obtain the total number of people.

[0049] In an embodiment of the present application, a trained neural network model is obtained by training a neural network model using a training set, wherein the training set includes a plurality of training sample pairs of different time periods, wherein the training sample pairs include a first input vector determined based on a detection request frame corresponding to the first perception area and a visual truth value determined based on the video stream; a second input vector corresponding to each of the perception areas is respectively input into the trained neural network model to obtain the number of people corresponding to each perception area, wherein the second input vector is determined based on the detection request frame corresponding to the perception area; and the total number of people is determined based on the number of people corresponding to each of the perception areas. In this way, a trained neural network model can be obtained first based on the detection request frame of the first perception area and the visual truth value of the first perception area, and then the trained neural network model and the detection request frame of each perception area are used to obtain the number of people corresponding to each perception area and thus the total number of people.

[0050] Optionally, in some embodiments, the using the training set to train the neural network model to obtain the trained neural network model includes:

[0051] Inputting the first input vectors in the training sample pairs of different time periods into the neural network model in sequence for training, and obtaining the number of people corresponding to the first perception area in different time periods;

[0052] For each time period, inputting the first input vector into the neural network model to obtain the number of people corresponding to the first sensing area;

[0053] Calculate a target loss function based on the number of people corresponding to the first perception area and the visual truth value in the training sample pair;

[0054] When the target loss function is less than a preset value, the neural network model is determined as a trained neural network model.

[0055] In the embodiment of the present application, the above-mentioned time period is the above-mentioned unit time.

[0056] Optionally, the camera is deployed at a location where people in the first perception area must pass. The advantage of such a setting is that the visual true value of the people in the first perception area can be obtained more accurately.

[0057] In an embodiment of the present application, through the above method, when the target loss function is less than a preset value, the neural network model is determined to be a trained neural network model. The advantage of this setting is that the trained neural network model predicts the second input vector and obtains the number of people in the corresponding perception area with higher accuracy.

[0058] Optionally, in some embodiments, before the step of training the neural network model using the training set to obtain the trained neural network model, the method further includes:

[0059] Receiving a first video stream of the first sensing area sent from the camera;

[0060] The first video stream is detected using a preset target detection algorithm to determine the visual true value.

[0061] It should be understood that the visual true value in the training sample pair is obtained by setting a camera in the first perception area, obtaining a video stream of the first perception area, and then using a head detection and counting algorithm based on YOLOv5s to count the number of people in the video stream to obtain the visual true value.

[0062] In the embodiment of the present application, through the above method, a relatively accurate total number of people in the first perception area can be obtained for verification of the neural network model.

[0063] Optionally, in some embodiments, before detecting the video stream using a preset target detection algorithm to determine the visual true value, the method further includes:

[0064] Receiving a second video stream of the first sensing area sent by the camera;

[0065] Annotating the first image in the second video stream using a picture annotation tool to obtain a first data set;

[0066] The target detection algorithm is trained using a second data set to obtain the preset target detection algorithm, where the second data set includes the first data set and an open source data set.

[0067] In the embodiment of the present application, the picture annotation tool annotates the first image in the second video stream, which can be understood as annotating a head in one of the images in the second video stream.

[0068] It should be understood that the open source dataset includes: SCUT-HEAD with a total of 4,405 annotated images and HollywoodHeads with a total of 224,740 annotated images.

[0069] In an embodiment of the present application, after training the target detection algorithm using the first data set and the second data set of the open source data set in the above manner, the preset target detection algorithm obtained has a higher accuracy in predicting the number of heads in the image.

[0070] Optionally, in some embodiments, before inputting the second input vector corresponding to each of the perception areas into the trained neural network model to obtain the number of people corresponding to each perception area, the method further includes:

[0071] Receiving a probe request frame from the AP;

[0072] Performing a cyclic redundancy check on the detection request frame to obtain a first reporting message, where the first reporting message is the detection request frame that passes the cyclic redundancy check;

[0073] Extracting a timestamp, an original random hardware address, and a signal strength in a second reporting message, wherein the second reporting message is a first reporting message whose signal strength is greater than a second preset threshold;

[0074] Pepper-encrypt the original random hardware address in the second report message to obtain the random hardware address

[0075] Obtaining a target reporting message of the AP according to the timestamp, the random hardware address and the signal strength;

[0076] Statistical processing is performed on the target reporting message to obtain the second input vector.

[0077] It should be understood that in the embodiment of the present application, the timestamp, original random hardware address and signal strength in the second report message can be extracted by referring to Figure 4 The original random hardware address is shown in the manner described, Figure 4 A method for extracting a random hardware address in a probe request frame is provided in an embodiment of the present application.

[0078] In an embodiment of the present application, a cyclic redundancy check is performed on the probe request frame, which can be used to detect whether an error occurs during the transmission or storage of data.

[0079] In the embodiment of the present application, the pepper encryption is a symmetric encryption algorithm that uses a secret key to encrypt and decrypt data, which can protect the security and integrity of the data and can serve the purpose of privacy protection.

[0080] In the embodiment of the present application, the second reporting message is the first reporting message whose signal strength is greater than the second preset threshold, so as to remove some first reporting messages whose signal strength is too low.

[0081] Optionally, in some embodiments, the target reporting message includes at least two signal groups, the signal groups including: a timestamp when the wireless device sends the probe request frame, a signal strength of the probe request frame, a random hardware address and an AP number of the probe request frame, and performing statistical processing on the target reporting message to obtain the second input vector includes:

[0082] Performing signal statistical processing on the signal group whose timestamps are in the same preset time period to obtain the number of random hardware addresses of each of the APs;

[0083] The second input vector is determined according to the number of random hardware addresses of each of the APs.

[0084] In the embodiment of the present application, the specific implementation process of performing signal statistical processing on the signal group whose timestamps are in the same preset time period to obtain the number of random hardware addresses of each AP is as follows:

[0085] The target reporting message includes at least two signal groups, the signal groups including: a timestamp when the mobile device sends the probe request frame, a signal strength of the probe request frame, a random hardware address of the probe request frame, and the AP number;

[0086] It should be understood that the AP obtains a signal group each time it receives a probe request frame sent from the mobile device, and the signal group includes: the timestamp of the probe request frame, the signal strength, the random hardware address and the AP number.

[0087] Furthermore, the crowd counting server may periodically receive target reporting messages from the AP, and within one period, the number of detection request frames sent by the mobile device and received by the AP is the number of signal groups in the target reporting messages sent by the AP to the crowd counting server within the period.

[0088] The timestamp of the mobile device sending the probe request frame can be understood as the time when the mobile device sends the probe request frame. The signal strength of the probe request frame can be understood as being determined according to the distance between the AP and the mobile device. The AP number can be understood as identification information artificially set for the AP, which is used to distinguish multiple APs. The random hardware address can be understood as the different hardware addresses in the probe request frames sent by the same mobile device at different times.

[0089] Performing signal statistical processing on the signal group whose timestamps are in the same preset time period to obtain the number of random hardware addresses of the N APs and the number of random hardware addresses of each AP;

[0090] It should be understood that the signal groups whose timestamps are in the same preset time period. When the preset time period is 12:01-12:02, the timestamp of the first signal group is 12:01:01, and the timestamp of the second signal group is 12:01:30; then the first signal group and the second signal group are signal groups whose timestamps are in the same preset time period.

[0091] It should be understood that the preset time period may be one minute or two minutes, and no further limitation is given here.

[0092] It should be noted that the two APs that are close in physical distance can receive the detection request frame sent from the same mobile device, but the internal signal strengths of the signal groups obtained by the two APs are different.

[0093] The second input vector is then constructed according to the number of random hardware addresses of each of the APs.

[0094] Optionally, in some embodiments, performing signal statistical processing on the signal group whose timestamps are in the same preset time period to obtain the number of random hardware addresses of each AP includes:

[0095] According to the timestamp of the signal group, the tuples corresponding to the signal group are divided into different time buckets, the tuples corresponding to the signal group being the signal group that does not include the timestamp;

[0096] It should be understood that the above-mentioned time bucket can be understood as a set of tuples corresponding to the signal group with the same timestamp.

[0097] Traversing the time bucket, determining the tuple corresponding to the signal group having the same random hardware address and the signal strength greater than the preset signal strength in the time bucket as the first tuple;

[0098] It should be noted that the preset signal strength of each AP may be the same or different.

[0099] Divide the AP number of the target tuple into a random hardware address bucket corresponding to the target tuple, the target tuple being the first tuple with the highest signal strength;

[0100] The random hardware address bucket may be understood as a set of AP numbers having the same timestamp and the same random hardware address.

[0101] Taking the AP number as a bucket, traverse the random hardware address bucket to obtain the number of random hardware addresses of each AP;

[0102] It should be noted that the number of random hardware addresses of each of the APs refers to the number of random hardware addresses of each of the APs within the preset time period.

[0103] The number of random hardware addresses of each of the APs is added together to obtain the number of random hardware addresses of N APs.

[0104] It should be noted that, when there are only N APs in communication connection with the crowd counting server, the number of random hardware addresses of each AP is added together to obtain the number of random hardware addresses of the N APs.

[0105] In this way, since the signal group in the same preset time period is subjected to signal statistical processing, the number of random hardware addresses of the N APs and the number of random hardware addresses of each AP are obtained, so that the number of people in each sensing area can be obtained according to the total number of target people, the number of random hardware addresses of the N APs and the number of random hardware addresses of each AP. This reduces the difficulty of determining the number of people in the sensing area.

[0106] Optionally, in some embodiments, determining the number of people in each sensing area according to the total number of the target population, the number of random hardware addresses of the N APs, and the number of random hardware addresses of each AP comprises:

[0107] Divide the total number of target people by the number of random hardware addresses of the N APs to obtain a target factor;

[0108] The target factor is multiplied by the number of random hardware addresses of each of the APs to obtain the number of people in each of the sensing areas.

[0109] Optionally, in some embodiments, the target factor may be an integer or a decimal. Therefore, after multiplying the target factor by the number of random hardware addresses of each AP, the number of people in the perception area obtained may also be a decimal. In this case, the first digit after the decimal point of the number of people in the perception area is rounded off to obtain the number of people in each perception area, and then the number of people in each perception area is added to obtain the first number of people. If the number of the first group of people is equal to the target total number of people, the rounded number of people in the perception area is determined as the number of people in each perception area; if the number of the first group of people is less than the target total number of people, the difference between the first group of people and the target total number of people is added to the number of people in the perception area with the largest first digit after the decimal point of the number of people in the perception area.

[0110] like Figure 5 As shown, an embodiment of the present application provides a structural schematic diagram of a WiFi-based crowd counting system.

[0111] exist Figure 5 In the example, the WiFi sensing part corresponds to the sensing area of ​​each AP. An AP is set in each sensing area. The AP in one sensing area can not only sense the detection request frame corresponding to its own sensing area, but also sense the detection request frames from other sensing areas.

[0112] For example, a detection request frame sent by a mobile device in the AP2 area can be sensed by AP2 as well as AP1 and AP3. However, the signal strength in the signal group sensed by AP2 is stronger than that in the signal group sensed by AP1 and AP3.

[0113] exist Figure 5 In the above, the data summary of each AP refers to the summary of the signal group obtained after each AP senses, and then sent to the crowd counting server in the form of a target reporting message.

[0114] The target report message is first pre-processed in the crowd counting server to obtain the first number of random hardware addresses that have been connected to the network, and the first number of random hardware addresses that have been connected to the network is input into the trained regression model to obtain the total number of target people. The trained regression model is obtained by offline training using the visual crowd counting truth system.

[0115] After preprocessing, the target report message is subjected to signal statistical processing to obtain result 1 and result 2. Result 1 is the number of hardware addresses of all APs, and result 2 is the number of hardware addresses of each AP.

[0116] Then, based on the total number of target people, the total number of hardware addresses of all APs, and the number of hardware addresses of each AP, the number of people in each sensing area is calculated.

[0117] like Figure 6 As shown, the embodiment of the present application provides a crowd counting device 600, which is applied to a crowd counting server, wherein the crowd counting server is connected to N wireless network detectors AP and cameras for communication, each of the APs corresponds to a sensing area, N is an integer greater than 1, the AP is used to monitor the detection request frame of the wireless device, the camera corresponds to a first sensing area, the first sensing area is any of the sensing areas, the camera is used to obtain a video stream of the first sensing area, and the device includes:

[0118] A first training module 601 is used to train a neural network model using a training set to obtain a trained neural network model, wherein the training set includes a plurality of training sample pairs in different time periods, wherein the training sample pairs include a first input vector determined based on a detection request frame corresponding to the first perception area and a visual truth value determined based on the video stream;

[0119] A first obtaining module 602 is used to input the second input vector corresponding to each of the sensing areas into the trained neural network model to obtain the number of people corresponding to each sensing area, wherein the second input vector is determined based on the detection request frame corresponding to the sensing area;

[0120] The determination module 603 is used to determine the total number of people according to the number of people corresponding to each of the sensing areas.

[0121] Optionally, the first training module 601 includes:

[0122] A training submodule, used for sequentially inputting the first input vectors in the training sample pairs of different time periods into the neural network model for training, so as to obtain the number of people corresponding to the first perception area in different time periods;

[0123] A first obtaining submodule is used for inputting the first input vector into the neural network model for each time period to obtain the number of people corresponding to the first sensing area;

[0124] A calculation submodule, configured to calculate a target loss function according to the number of people corresponding to the first perception area and the visual truth value in the training sample pair;

[0125] The first determination submodule is used to determine the neural network model as a trained neural network model when the target loss function is less than a preset value.

[0126] Optionally, the crowd counting device 600 further includes:

[0127] A first receiving module, used for receiving a first video stream of the first sensing area sent from the camera;

[0128] The detection module is used to detect the first video stream using a preset target detection algorithm to determine the visual true value.

[0129] Optionally, the crowd counting device 600 further includes:

[0130] A second receiving module, used for receiving a second video stream of the first sensing area sent from the camera;

[0131] a labeling module, configured to label the first image in the second video stream using a picture labeling tool to obtain a first data set;

[0132] The second training module is used to train the target detection algorithm using a second data set to obtain the preset target detection algorithm, where the second data set includes the first data set and an open source data set.

[0133] Optionally, the crowd counting device 600 further includes:

[0134] A third receiving module, configured to receive a detection request frame from the AP;

[0135] A second obtaining module is used to perform a cyclic redundancy check on the detection request frame to obtain a first reporting message, where the first reporting message is the detection request frame that passes the cyclic redundancy check;

[0136] An extraction module, used to extract a timestamp, an original random hardware address and a signal strength in a second report message, wherein the second report message is a first report message whose signal strength is greater than a second preset threshold;

[0137] The third obtaining module is used to perform pepper encryption on the original random hardware address in the second reporting message to obtain the random hardware address

[0138] A fourth obtaining module, configured to obtain a target reporting message of the AP according to the timestamp, the random hardware address and the signal strength;

[0139] The fifth obtaining module is used to perform statistical processing on the target reporting message to obtain the second input vector.

[0140] Optionally, the target reporting message includes at least two signal groups, the signal groups including: a timestamp when the wireless device sends the probe request frame, a signal strength of the probe request frame, a random hardware address and an AP number of the probe request frame; and the fifth obtaining module includes:

[0141] A second obtaining submodule is used to perform signal statistical processing on the signal group whose timestamps are in the same preset time period to obtain the number of random hardware addresses of each AP;

[0142] The second determining submodule is used to determine the second input vector according to the number of random hardware addresses of each of the APs.

[0143] The crowd counting device 600 can realize the Figure 1 The various processes of the method embodiment and the same beneficial effects are achieved, and will not be described again here to avoid repetition.

[0144] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0145] The present application also provides an electronic device. Figure 7 , the electronic device may include a processor 701, a memory 702, and a program 7021 stored in the memory 702 and executable on the processor 701.

[0146] When the program 7021 is executed by the processor 701, it can achieve Figure 1 Any steps in the corresponding method embodiments and achieving the same beneficial effects will not be repeated here.

[0147] Those skilled in the art will appreciate that all or part of the steps of implementing the above-mentioned embodiment method can be completed by hardware associated with program instructions, and the program can be stored in a readable medium.

[0148] The present application also provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the above-mentioned Figure 1 Any steps in the corresponding method embodiments can achieve the same technical effect and will not be repeated here to avoid repetition.

[0149] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises one..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be noted that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0150] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A crowd counting method, characterized in that: Applied to a crowd counting server, the crowd counting server is connected to N wireless network detectors AP and cameras, each AP corresponds to a sensing area, N is an integer greater than 1, the AP is used to monitor the detection request frame of the wireless device, the camera corresponds to the first sensing area, the first sensing area is any of the sensing areas, the camera is used to obtain the video stream of the first sensing area, the method includes: Training a neural network model using a training set to obtain a trained neural network model, wherein the training set includes a plurality of training sample pairs at different time periods, wherein the training sample pairs include a first input vector determined based on a detection request frame corresponding to the first perception area and a visual truth value determined based on the video stream; Inputting the second input vector corresponding to each of the sensing areas into the trained neural network model respectively to obtain the number of people corresponding to each sensing area, wherein the second input vector is determined based on the corresponding detection request frame of the sensing area; Determine the total number of people according to the number of people corresponding to each of the sensing areas; Before inputting the second input vectors corresponding to each of the perception areas into the trained neural network model to obtain the number of people corresponding to each perception area, the method further includes: Receiving a probe request frame from the AP; Performing a cyclic redundancy check on the detection request frame to obtain a first reporting message, where the first reporting message is the detection request frame that passes the cyclic redundancy check; Extracting a timestamp, an original random hardware address, and a signal strength in a second reporting message, wherein the second reporting message is a first reporting message whose signal strength is greater than a second preset threshold; Pepper-encrypt the original random hardware address in the second report message to obtain the random hardware address; Obtaining a target reporting message of the AP according to the timestamp, the random hardware address and the signal strength; Performing statistical processing on the target report message to obtain the second input vector; The target reporting message includes at least two signal groups, the signal groups including: a timestamp when the wireless device sends the probe request frame, a signal strength of the probe request frame, a random hardware address and an AP number of the probe request frame, and the performing of statistical processing on the target reporting message to obtain the second input vector includes: Performing signal statistical processing on the signal group whose timestamps are in the same preset time period to obtain the number of random hardware addresses of each of the APs; Determining the second input vector according to the number of random hardware addresses of each of the APs; The first input vector is determined according to a plurality of first random hardware address quantity values, a mean value of the first random hardware address quantity, and a standard deviation of the first random hardware address quantity received by the AP corresponding to the first sensing area within a preset time period, and the mean value of the first random hardware address quantity and the standard deviation of the first random hardware address quantity are determined according to the plurality of first random hardware address quantity values; The second input vector is determined based on multiple second random hardware address quantity values, a mean value of the second random hardware address quantity, and a standard deviation of the second random hardware address quantity received by the AP corresponding to each perception area within the preset time period, and the mean value of the second random hardware address quantity and the standard deviation of the second random hardware address quantity are determined based on the multiple second random hardware address quantity values.

2. The method according to claim 1, characterized in that The neural network model is trained by using the training set to obtain the trained neural network model, which includes: Inputting the first input vectors in the training sample pairs of different time periods into the neural network model in sequence for training, and obtaining the number of people corresponding to the first perception area in different time periods; For each time period, inputting the first input vector into the neural network model to obtain the number of people corresponding to the first sensing area; Calculate a target loss function based on the number of people corresponding to the first perception area and the visual truth value in the training sample pair; When the target loss function is less than a preset value, the neural network model is determined as a trained neural network model.

3. The method according to claim 1, characterized in that Before the neural network model is trained using the training set to obtain the trained neural network model, the method further includes: Receiving a first video stream of the first sensing area sent from the camera; The first video stream is detected using a preset target detection algorithm to determine the visual true value.

4. The method according to claim 3, characterized in that Before detecting the video stream using a preset target detection algorithm to determine the visual true value, the method further includes: Receiving a second video stream of the first sensing area sent by the camera; Annotating the first image in the second video stream using a picture annotation tool to obtain a first data set; The target detection algorithm is trained using a second data set to obtain the preset target detection algorithm, where the second data set includes the first data set and an open source data set.

5. A crowd counting device, characterized in that: Applied to a crowd counting server, the crowd counting server is connected to N wireless network detectors AP and cameras, each AP corresponds to a sensing area, N is an integer greater than 1, the AP is used to monitor the detection request frame of the wireless device, the camera corresponds to the first sensing area, the first sensing area is any of the sensing areas, the camera is used to obtain the video stream of the first sensing area, and the device includes: A first training module is used to train the neural network model using a training set to obtain a trained neural network model, wherein the training set includes a plurality of training sample pairs in different time periods, and the training sample pairs include a first input vector determined based on a detection request frame corresponding to the first perception area and a visual truth value determined based on the video stream; A first obtaining module, configured to input a second input vector corresponding to each of the sensing areas into the trained neural network model to obtain a number of people corresponding to each sensing area, wherein the second input vector is determined based on a detection request frame corresponding to the sensing area; A determination module, used to determine the total number of people according to the number of people corresponding to each of the sensing areas; A third receiving module, configured to receive a detection request frame from the AP; A second obtaining module is used to perform a cyclic redundancy check on the detection request frame to obtain a first reporting message, where the first reporting message is the detection request frame that passes the cyclic redundancy check; An extraction module, used to extract a timestamp, an original random hardware address and a signal strength in a second report message, wherein the second report message is a first report message whose signal strength is greater than a second preset threshold; The third obtaining module is used to perform pepper encryption on the original random hardware address in the second reporting message to obtain the random hardware address A fourth obtaining module, configured to obtain a target reporting message of the AP according to the timestamp, the random hardware address and the signal strength; a fifth obtaining module, configured to perform statistical processing on the target reporting message to obtain the second input vector; The target reporting message includes at least two signal groups, the signal groups including: the timestamp of the wireless device sending the probe request frame, the signal strength of the probe request frame, the random hardware address and AP number of the probe request frame; the fifth obtaining module includes: A second obtaining submodule is used to perform signal statistical processing on the signal group whose timestamps are in the same preset time period to obtain the number of random hardware addresses of each AP; A second determining submodule, configured to determine the second input vector according to the number of random hardware addresses of each of the APs; The first input vector is determined according to a plurality of first random hardware address quantity values, a mean value of the first random hardware address quantity, and a standard deviation of the first random hardware address quantity received by the AP corresponding to the first sensing area within a preset time period, and the mean value of the first random hardware address quantity and the standard deviation of the first random hardware address quantity are determined according to the plurality of first random hardware address quantity values; The second input vector is determined based on multiple second random hardware address quantity values, a mean value of the second random hardware address quantity, and a standard deviation of the second random hardware address quantity received by the AP corresponding to each perception area within the preset time period, and the mean value of the second random hardware address quantity and the standard deviation of the second random hardware address quantity are determined based on the multiple second random hardware address quantity values.

6. A computer program product, characterized in that The method comprises computer instructions, which, when processed and executed, implement the steps of the crowd counting method according to any one of claims 1 to 4.

7. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the crowd counting method according to any one of claims 1 to 4 are implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the crowd counting method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • People number monitoring method and device, electronic equipment and readable storage medium

    CN116012776A