Method for identifying people flow data and method for training people flow data identification model
Patent Information
- Application Number
- CN202310188964.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-01
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-03-01
AI Technical Summary
[0004]本发明所要解决的技术问题在于,通过人工去统计人流量的效率较低
[0082]本发明实施例中,通过获取预设点位的第一时空数据矩阵;将所述第一时空数据矩阵输入至训练完成的人流量数据识别模型中,得到所述预设点位的目标人流量热力图,所述人流量数据识别模型是通过将所述预设点位的第二时空数据矩阵与真实人流量热力图输入至生成对抗网络进行训练得到的;根据所述目标人流量热力图确定所述预设点位的目标人流量数据,由于在获取到预设点位的第一时空数据矩阵以后,即可通过人流量数据识别模型确定出目标人流量热力图,从而根据目标人流量热力图确定预设点位的目标人流量数据,由此,可以减少人工的干预,从而提高人流量统计的效率。此外,还能够提高人流量统计的准确性。
Smart Images

Figure CN116168213B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method for identifying pedestrian flow data, a method for training a pedestrian flow data identification model, and an apparatus thereof. Background Technology
[0002] With the development of computer technology, it is becoming increasingly important to know how to use computers to improve the convenience of life.
[0003] Currently, in some scenarios, such as analyzing store foot traffic, the number of customers is counted manually. However, manually recording foot traffic results in low efficiency in this statistical method. Summary of the Invention
[0004] The technical problem this invention aims to solve is that manually counting pedestrian traffic is inefficient. Therefore, this invention provides a method for identifying pedestrian traffic data, a method for training a pedestrian traffic data identification model, and an apparatus thereof, which can help improve the efficiency of pedestrian traffic statistics.
[0005] To address the aforementioned technical problems, the first aspect of this invention discloses a method for identifying pedestrian flow data, the method comprising:
[0006] Obtain the first spatiotemporal data matrix of the preset points;
[0007] The first spatiotemporal data matrix is input into the trained pedestrian flow data recognition model to obtain the target pedestrian flow heat map of the preset location. The pedestrian flow data recognition model is obtained by inputting the second spatiotemporal data matrix of the preset location and the real pedestrian flow heat map into a generative adversarial network for training.
[0008] The target pedestrian flow data for the preset points is determined based on the target pedestrian flow heat map.
[0009] As an optional implementation, in a first aspect of the present invention, the target pedestrian flow heatmap includes a plurality of first pixels, the plurality of first pixels having at least two gray levels, each gray level being configured with a target weight coefficient, and the step of determining the target pedestrian flow data of the preset location based on the target pedestrian flow heatmap includes:
[0010] The target pixel value of the target pedestrian flow heatmap is determined based on the gray level of each first pixel and the target weight coefficient corresponding to each gray level. The target pixel value is positively correlated with the first target product corresponding to each first pixel. The first target product is the product between the gray level of the first pixel and the target weight coefficient corresponding to the gray level.
[0011] The target pedestrian flow data for the preset location is determined based on the target pixel value.
[0012] As an optional implementation, in the first aspect of the present invention, the method further includes:
[0013] Obtain at least two real pedestrian flow heatmaps, each of which includes multiple second pixels, and the multiple second pixels have at least two grayscale values;
[0014] Configure the initial weight coefficients for each grayscale level;
[0015] Based on the grayscale of each second pixel in each of the real pedestrian flow heatmaps and the initial weight coefficient corresponding to each grayscale, the initial pixel value of each of the real pedestrian flow heatmaps is determined, wherein the initial pixel value is positively correlated with the second target product corresponding to each second pixel, and the second target product is the product between the grayscale of the second pixel and the initial weight coefficient corresponding to the grayscale.
[0016] Determine whether the initial weight coefficients corresponding to each grayscale level meet the preset conditions based on the initial pixel values of each of the real pedestrian flow heatmaps.
[0017] If the initial weight coefficients corresponding to each gray level meet the preset conditions, then the initial weight coefficients corresponding to each gray level will be used as the target weight coefficients corresponding to each gray level.
[0018] If the initial weight coefficients corresponding to each gray level do not meet the preset conditions, the steps for configuring the initial weight coefficients corresponding to each gray level will be repeated.
[0019] As an optional implementation, in the first aspect of the present invention, at least two of the real pedestrian flow heatmaps are obtained by collecting data from at least two preset locations. The step of determining whether the initial weight coefficient corresponding to each grayscale value satisfies preset conditions based on the initial pixel values of each of the real pedestrian flow heatmaps includes:
[0020] If the first relationship matches the second relationship, then the initial weight coefficients corresponding to each gray level are determined to meet the preset conditions. The first relationship is the relationship between the initial pixel values corresponding to at least two real traffic heatmaps, and the second relationship is the relationship between the real traffic data corresponding to at least two preset points.
[0021] And / or,
[0022] At least two of the aforementioned real pedestrian flow heatmaps were obtained by collecting data from the same preset location at at least two different times. The step of determining whether the initial weight coefficients corresponding to each grayscale level meet preset conditions based on the initial pixel values of each of the aforementioned real pedestrian flow heatmaps includes:
[0023] If the first relationship matches the third relationship, then the initial weight coefficients corresponding to each gray level are determined to meet the preset conditions. The third relationship is the relationship between the real pedestrian flow data corresponding to at least two time points.
[0024] As an optional implementation, in the first aspect of the present invention, determining the target pedestrian flow data at the preset location based on the target pixel value includes:
[0025] Obtain the correspondence between pixel values and pedestrian flow data, wherein the correspondence is determined under the condition that the initial weight coefficients corresponding to each gray level meet preset conditions;
[0026] Based on the correspondence, the pedestrian flow data corresponding to the target pixel value is taken as the target pedestrian flow data.
[0027] A second aspect of this invention discloses a method for identifying pedestrian flow data, the method comprising:
[0028] Obtain real pedestrian flow heatmaps and a second spatiotemporal data matrix at preset locations;
[0029] The real pedestrian flow heat map and the second spatiotemporal data matrix are input into a generative adversarial network for training to obtain a trained pedestrian flow data recognition model. The pedestrian flow data recognition model is used to identify the target pedestrian flow data at the preset location.
[0030] As an optional implementation, in a second aspect of the invention, the generative adversarial network includes a generator and a discriminator. The step of inputting the real pedestrian flow heatmap and the second spatiotemporal data matrix into the generative adversarial network for training to obtain a trained pedestrian flow data recognition model includes:
[0031] The second spatiotemporal data matrix is input into the generator to obtain the heat map of pedestrian flow to be determined;
[0032] The heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow are input into the discriminator to obtain the identification loss between the heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow. The identification loss is used to represent the similarity between the heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow.
[0033] If the recognition loss is less than or equal to the loss threshold, then the training of the pedestrian flow data recognition model is considered complete.
[0034] If the recognition loss is greater than the loss threshold, a new pedestrian flow heatmap to be judged is generated by the generator, and the recognition loss between the new pedestrian flow heatmap and the real pedestrian flow heatmap is obtained by the discriminator.
[0035] As an optional implementation, in a second aspect of the invention, before inputting the real pedestrian flow heatmap and the second spatiotemporal data matrix into the generative adversarial network for training, the method further includes:
[0036] Obtain the original layer of the preset points;
[0037] The heat map of real pedestrian flow is processed by removing redundant information based on the original layer of the preset points to obtain the heat map of real pedestrian flow after removing redundant information.
[0038] The step of inputting the real pedestrian flow heatmap and the second spatiotemporal data matrix into the generative adversarial network for training includes:
[0039] The heat map of real pedestrian flow after removing redundant information and the second spatiotemporal data matrix are input into the generative adversarial network for training.
[0040] A third aspect of the present invention discloses a device for identifying pedestrian flow data, the device comprising:
[0041] The first acquisition module is used to acquire the first spatiotemporal data matrix of the preset points;
[0042] The input module is used to input the first spatiotemporal data matrix into the trained pedestrian flow data recognition model to obtain the target pedestrian flow heat map of the preset location. The pedestrian flow data recognition model is trained by inputting the second spatiotemporal data matrix of the preset location and the real pedestrian flow heat map into a generative adversarial network.
[0043] The pedestrian flow data identification module is used to determine the target pedestrian flow data of the preset point based on the target pedestrian flow heat map.
[0044] As an optional implementation, in a third aspect of the present invention, the target pedestrian flow heatmap includes a plurality of first pixels, the plurality of first pixels having at least two gray levels, each gray level being configured with a target weight coefficient, and the pedestrian flow data identification module comprising:
[0045] A pixel value determination unit is used to determine the target pixel value of the target pedestrian flow heat map based on the gray level of each first pixel and the target weight coefficient corresponding to each gray level, wherein the target pixel value is positively correlated with the first target product corresponding to each first pixel, and the first target product is the product between the gray level of the first pixel and the target weight coefficient corresponding to the gray level;
[0046] A pedestrian flow data identification unit is used to determine the target pedestrian flow data of the preset point based on the target pixel value.
[0047] As an optional implementation, in a third aspect of the invention, the device further includes:
[0048] The weight coefficient determination module is used to acquire at least two real pedestrian flow heat maps, each of which includes multiple second pixels, and the multiple second pixels have at least two gray levels;
[0049] Configure the initial weight coefficients for each grayscale level;
[0050] Based on the grayscale of each second pixel in each of the real pedestrian flow heatmaps and the initial weight coefficient corresponding to each grayscale, the initial pixel value of each of the real pedestrian flow heatmaps is determined, wherein the initial pixel value is positively correlated with the second target product corresponding to each second pixel, and the second target product is the product between the grayscale of the second pixel and the initial weight coefficient corresponding to the grayscale.
[0051] Determine whether the initial weight coefficients corresponding to each grayscale level meet the preset conditions based on the initial pixel values of each of the real pedestrian flow heatmaps.
[0052] If the initial weight coefficients corresponding to each gray level meet the preset conditions, then the initial weight coefficients corresponding to each gray level will be used as the target weight coefficients corresponding to each gray level.
[0053] If the initial weight coefficients corresponding to each gray level do not meet the preset conditions, the steps for configuring the initial weight coefficients corresponding to each gray level will be repeated.
[0054] As an optional implementation, in a third aspect of the invention, at least two of the aforementioned real pedestrian flow heat maps are obtained by collecting data from at least two preset locations, and the weighting coefficient determination module includes:
[0055] The first weight coefficient determination unit is used to determine that the initial weight coefficients corresponding to each gray level meet the preset conditions if the first relationship matches the second relationship. The first relationship is the relationship between the initial pixel values corresponding to at least two real traffic heat maps, and the second relationship is the relationship between the real traffic data corresponding to at least two preset points.
[0056] And / or,
[0057] At least two of the aforementioned real pedestrian flow heatmaps were obtained by collecting data from the same preset location at at least two different times. The weighting coefficient determination module includes:
[0058] The second weight coefficient determination unit is used to determine that the initial weight coefficients corresponding to each gray level meet the preset conditions if the first relationship matches the third relationship. The third relationship is the relationship between the real traffic data corresponding to at least two time points.
[0059] As an optional implementation, in a third aspect of the present invention, the pedestrian flow data identification unit is used to obtain the correspondence between pixel values and pedestrian flow data, wherein the correspondence is determined under the condition that the initial weight coefficients corresponding to each gray level meet preset conditions;
[0060] Based on the correspondence, the pedestrian flow data corresponding to the target pixel value is taken as the target pedestrian flow data.
[0061] A fourth aspect of the present invention discloses a training device for a pedestrian flow data recognition model, the device comprising:
[0062] The second acquisition module is used to acquire the real pedestrian flow heat map and the second spatiotemporal data matrix at preset locations;
[0063] The training module is used to input the real pedestrian flow heat map and the second spatiotemporal data matrix into the generative adversarial network for training, so as to obtain a trained pedestrian flow data recognition model. The pedestrian flow data recognition model is used to identify the target pedestrian flow data at the preset location.
[0064] As an optional implementation, in a fourth aspect of the present invention, the generative adversarial network includes a generator and a discriminator, and the training module is used to input the second spatiotemporal data matrix into the generator to obtain a heat map of pedestrian traffic to be discriminated.
[0065] The heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow are input into the discriminator to obtain the identification loss between the heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow. The identification loss is used to represent the similarity between the heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow.
[0066] If the recognition loss is less than or equal to the loss threshold, then the training of the pedestrian flow data recognition model is considered complete.
[0067] If the recognition loss is greater than the loss threshold, a new heatmap of pedestrian flow to be judged is generated by the generator, and the recognition loss between the new heatmap of pedestrian flow to be judged and the real heatmap of pedestrian flow is obtained by the discriminator.
[0068] As an optional implementation, in a fourth aspect of the invention, the device further includes:
[0069] The removal module is used to obtain the original layer of the preset point;
[0070] The heat map of real pedestrian flow is processed by removing redundant information based on the original layer of the preset points to obtain the heat map of real pedestrian flow after removing redundant information.
[0071] This training module is used to input the real pedestrian flow heat map after removing redundant information and the second spatiotemporal data matrix into the generative adversarial network for training.
[0072] The fifth aspect of the present invention discloses another device for identifying pedestrian flow data, the device comprising:
[0073] Memory containing executable program code;
[0074] A processor coupled to the memory;
[0075] The processor calls the executable program code stored in the memory to execute the method for identifying pedestrian flow data disclosed in the first aspect of the present invention.
[0076] The sixth aspect of this invention discloses another training apparatus for a pedestrian flow data recognition model, the apparatus comprising:
[0077] Memory containing executable program code;
[0078] A processor coupled to the memory;
[0079] The processor calls the executable program code stored in the memory to execute the training method of the pedestrian flow data recognition model disclosed in the second aspect of the present invention.
[0080] The seventh aspect of the present invention discloses a computer-storable medium storing computer instructions, which, when invoked, are used to execute the methods disclosed in the first and / or second aspects of the present invention.
[0081] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0082] In this embodiment of the invention, a first spatiotemporal data matrix of preset locations is obtained; this first spatiotemporal data matrix is input into a trained pedestrian flow data recognition model to obtain a target pedestrian flow heatmap for the preset locations. The pedestrian flow data recognition model is trained by inputting a second spatiotemporal data matrix of the preset locations and a real pedestrian flow heatmap into a generative adversarial network. The target pedestrian flow data for the preset locations is determined based on the target pedestrian flow heatmap. Since the target pedestrian flow heatmap can be determined directly from the first spatiotemporal data matrix of the preset locations after obtaining the first spatiotemporal data matrix, the target pedestrian flow data for the preset locations can be determined based on the target pedestrian flow heatmap. This reduces manual intervention and improves the efficiency of pedestrian flow statistics. Furthermore, it also improves the accuracy of pedestrian flow statistics. Attached Figure Description
[0083] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0084] Figure 1 This is a flowchart illustrating a method for identifying pedestrian flow data disclosed in an embodiment of the present invention;
[0085] Figure 2 This is a flowchart illustrating a training method for a pedestrian flow data recognition model disclosed in an embodiment of the present invention.
[0086] Figure 3 This is a schematic diagram of a framework for identifying pedestrian flow data disclosed in an embodiment of the present invention;
[0087] Figure 4 This is a schematic diagram of the structure of a pedestrian flow data identification device disclosed in an embodiment of the present invention;
[0088] Figure 5 This is a schematic diagram of the structure of a training device for a pedestrian flow data recognition model disclosed in an embodiment of the present invention;
[0089] Figure 6 This is a schematic diagram of the structure of another pedestrian flow data identification device disclosed in an embodiment of the present invention;
[0090] Figure 7 This is a schematic diagram of the structure of a training device for a pedestrian flow data recognition model disclosed in an embodiment of the present invention. Detailed Implementation
[0091] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0092] The terms "second," "first," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.
[0093] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0094] This invention discloses a method for identifying pedestrian flow data, a method for training a pedestrian flow data identification model, and an apparatus thereof, which can help improve the efficiency of pedestrian flow statistics. These will be described in detail below.
[0095] Example 1
[0096] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for identifying pedestrian flow data disclosed in an embodiment of the present invention. Figure 1 The described method for identifying pedestrian flow data can be applied to devices for identifying pedestrian flow data. These devices can be terminals, servers, or processors with data processing capabilities, such as chips; no specific limitations are imposed here. Figure 1 As shown, the method for identifying this pedestrian flow data may include the following operations:
[0097] Step 110: Obtain the first spatiotemporal data matrix of the preset points.
[0098] Among them, preset locations refer to the locations where pedestrian traffic data needs to be determined. For example, a preset location could be a specific store, a business district, or a specific area within a business district; it can be set as needed and is not limited here. The first spatiotemporal data matrix is used to represent the spatiotemporal data of the preset locations. Spatiotemporal data is data that simultaneously possesses time and spatial dimensions. Due to the inherent characteristics of spatial entities and phenomena in the space they reside in regarding time, space, and attributes, spatiotemporal data exhibits a complexity of multidimensionality, semantics, and dynamic spatiotemporal relationships.
[0099] It should be noted that the first spatiotemporal data matrix in this embodiment can be a data matrix with a set dimension. Optionally, the set dimension can be set as needed and is not limited here. Optionally, data mining and feature engineering can be used to quickly extract the spatiotemporal data of a specific location from the data acquisition interface through a specific point radius or grid (for example, the human field features with a radius of 500 meters centered on the point can be 478-dimensional features, and the processing method is mainly based on the original data of the POI point to generate through statistical calculation) and preprocess it into a data matrix of fixed dimensions as the input of the subsequent model.
[0100] Understandably, the advantage of constructing inputs in the above manner is that, depending on the difficulty of collection, more easily collected and representative spatiotemporal data (scene information and multi-party flow data) can be selected for feature construction.
[0101] Step 120: Input the first spatiotemporal data matrix into the trained pedestrian flow data recognition model to obtain the target pedestrian flow heat map of the preset location. The pedestrian flow data recognition model is obtained by inputting the second spatiotemporal data matrix of the preset location and the real pedestrian flow heat map into a generative adversarial network for training.
[0102] In this context, a pedestrian flow heatmap refers to a heatmap used to represent pedestrian flow data. In this embodiment, the target pedestrian flow heatmap is obtained by processing the first spatiotemporal data matrix using a pedestrian flow data recognition model. The real pedestrian flow heatmap is the actual pedestrian flow heatmap collected. In this embodiment, the real pedestrian flow heatmap can be captured from preset locations using a virtual server over a 24-hour period, maintaining consistent resolution throughout the acquisition process. The generative adversarial network (GAN) comprises a generative model and a discriminative model. The generative model is responsible for capturing the distribution of sample data, while the discriminative model is typically a binary classifier that distinguishes between real data and generated samples. The optimization process of this model is a "binary minimax game" problem. During training, one side (the discriminative network or the generative network) is fixed, while the parameters of the other model are updated, iterating alternately until the generative model can estimate the distribution of the sample data.
[0103] The second spatiotemporal data matrix can have the same dimensions as the first spatiotemporal data matrix.
[0104] Step 130: Determine the target pedestrian flow data at the preset points based on the target pedestrian flow heat map.
[0105] The target pedestrian flow heatmap is a heatmap used to determine pedestrian flow data. Target pedestrian flow data indicates the size of pedestrian flow at a predetermined location. Specifically, the target pedestrian flow data can be the number of people or an index; no limitation is made here.
[0106] The technical solution of this embodiment involves acquiring a first spatiotemporal data matrix of preset locations; inputting the first spatiotemporal data matrix into a trained pedestrian flow data recognition model to obtain a target pedestrian flow heatmap for the preset locations. The pedestrian flow data recognition model is trained by inputting a second spatiotemporal data matrix of the preset locations and a real pedestrian flow heatmap into a generative adversarial network; and determining the target pedestrian flow data for the preset locations based on the target pedestrian flow heatmap. Since the target pedestrian flow heatmap can be determined directly from the first spatiotemporal data matrix of the preset locations, the manual intervention can be reduced, thereby improving the efficiency of pedestrian flow statistics. Furthermore, it can also improve the accuracy of pedestrian flow statistics.
[0107] In one possible implementation, the target pedestrian flow heatmap includes a plurality of first pixels, each of which has at least two grayscale levels, and each grayscale level is configured with a target weight coefficient. The step of determining the target pedestrian flow data for the preset location based on the target pedestrian flow heatmap includes:
[0108] The target pixel value of the target pedestrian flow heatmap is determined based on the gray level of each first pixel and the target weight coefficient corresponding to each gray level. The target pixel value is positively correlated with the first target product corresponding to each first pixel. The first target product is the product between the gray level of the first pixel and the target weight coefficient corresponding to the gray level.
[0109] The target pedestrian flow data for the preset location is determined based on the target pixel value.
[0110] In this embodiment, different gray levels can correspond to different target weight coefficients. Generally, the smaller the gray level, the darker the color, the larger the weight, and the denser the pedestrian flow. Optionally, multiple first pixels can have at least two gray levels, for example, seven gray levels. It should be noted that the types of gray levels in the target pedestrian flow heatmap of this embodiment can be set as needed, and then certain image processing is performed according to the settings to make the types of gray levels in the target pedestrian flow heatmap consistent with the settings. Positive correlation means that as one variable increases, another variable also increases. In this embodiment, the target pixel value is positively correlated with the first target product corresponding to each first pixel, that is, the larger the first target product corresponding to each first pixel, the larger the target pixel value.
[0111] In one possible implementation, the target pixel value can be obtained by weighted averaging based on the gray level of each first pixel and the target weight coefficient corresponding to each gray level. In other words, the pixel value corresponding to each first pixel can be calculated based on the gray level of each first pixel and the target weight coefficient corresponding to each gray level, and then the pixel values corresponding to all first pixels can be accumulated to obtain the target pixel value.
[0112] In this embodiment, the applicant has discovered that the target pixel value of the target pedestrian flow heatmap is determined based on the gray level of each first pixel and the target weight coefficient corresponding to each gray level, which has a certain relationship with the pedestrian flow data. Therefore, this embodiment can determine the target pedestrian flow data of the preset point based on the target pixel value.
[0113] The following examples, based on any of the above examples, illustrate how to determine the target weight coefficients corresponding to each gray level.
[0114] In one possible implementation, this embodiment determines the target weight coefficient corresponding to each gray level in the following way:
[0115] Obtain at least two real pedestrian flow heatmaps, each of which includes multiple second pixels, and the multiple second pixels have at least two grayscale values;
[0116] Configure the initial weight coefficients for each grayscale level;
[0117] Based on the grayscale of each second pixel in each of the real pedestrian flow heatmaps and the initial weight coefficient corresponding to each grayscale, the initial pixel value of each of the real pedestrian flow heatmaps is determined, wherein the initial pixel value is positively correlated with the second target product corresponding to each second pixel, and the second target product is the product between the grayscale of the second pixel and the initial weight coefficient corresponding to the grayscale.
[0118] Determine whether the initial weight coefficients corresponding to each grayscale level meet the preset conditions based on the initial pixel values of each of the real pedestrian flow heatmaps.
[0119] If the initial weight coefficients corresponding to each gray level meet the preset conditions, then the initial weight coefficients corresponding to each gray level will be used as the target weight coefficients corresponding to each gray level.
[0120] If the initial weight coefficients corresponding to each gray level do not meet the preset conditions, the steps for configuring the initial weight coefficients corresponding to each gray level will be repeated.
[0121] The second target product can be referred to in the explanation of the first target product, and will not be repeated here. The preset condition is used to indicate that the initial pixel values calculated based on the initial weight coefficients corresponding to each gray level correspond to the actual pedestrian flow data. In this embodiment, if the initial weight coefficients corresponding to each gray level meet the preset condition, it means that the pixel values calculated according to the initial weights correspond to the actual pedestrian flow data, and therefore the initial weight coefficients corresponding to each gray level can be used as the target weight coefficients corresponding to each gray level. If the initial weight coefficients corresponding to each gray level do not meet the preset condition, it means that the pixel values calculated according to the initial weights do not correspond to the actual pedestrian flow data, and therefore the initial weight coefficients corresponding to each gray level need to be reconfigured until the initial weight coefficients corresponding to each gray level meet the preset condition.
[0122] The technical solution of this embodiment involves acquiring at least two real pedestrian flow heatmaps, each heatmap including multiple second pixels, each second pixel having at least two grayscale levels; configuring initial weight coefficients corresponding to each grayscale level; determining initial pixel values for each real pedestrian flow heatmap based on the grayscale of each second pixel and the initial weight coefficients corresponding to each grayscale level, wherein the initial pixel values are positively correlated with the second target product corresponding to each second pixel, the second target product being the product between the grayscale of the second pixel and the initial weight coefficient corresponding to the grayscale level; determining whether the initial weight coefficients corresponding to each grayscale level meet preset conditions based on the initial pixel values of each real pedestrian flow heatmap; if the initial weight coefficients corresponding to each grayscale level meet the preset conditions, then the initial weight coefficients corresponding to each grayscale level are used as the target weight coefficients corresponding to each grayscale level; if the initial weight coefficients corresponding to each grayscale level do not meet the preset conditions, then the step of configuring the initial weight coefficients corresponding to each grayscale level is re-executed, thereby determining suitable target weight coefficients and making the identification of target pedestrian flow data more accurate.
[0123] In one possible implementation, at least two of the real pedestrian flow heatmaps are obtained by collecting data from at least two preset locations. The step of determining whether the initial weight coefficients corresponding to each grayscale level meet preset conditions based on the initial pixel values of each of the real pedestrian flow heatmaps includes:
[0124] If the first relationship matches the second relationship, then the initial weight coefficients corresponding to each gray level are determined to meet the preset conditions. The first relationship is the relationship between the initial pixel values corresponding to at least two real traffic heatmaps, and the second relationship is the relationship between the real traffic data corresponding to at least two preset points.
[0125] And / or,
[0126] At least two of the aforementioned real pedestrian flow heatmaps were obtained by collecting data from the same preset location at at least two different times. The step of determining whether the initial weight coefficients corresponding to each grayscale level meet preset conditions based on the initial pixel values of each of the aforementioned real pedestrian flow heatmaps includes:
[0127] If the first relationship matches the third relationship, then the initial weight coefficients corresponding to each gray level are determined to meet the preset conditions. The third relationship is the relationship between the real pedestrian flow data corresponding to at least two time points.
[0128] In one possible implementation, if at least two of the real pedestrian flow heatmaps are obtained by collecting data from at least two preset locations, then determining whether the initial weight coefficients corresponding to each grayscale value meet preset conditions based on the initial pixel values of each of the real pedestrian flow heatmaps includes:
[0129] If the first relationship matches the second relationship, then the initial weight coefficients corresponding to each gray level are determined to meet the preset conditions. The first relationship is the relationship between the initial pixel values corresponding to at least two real pedestrian flow heatmaps, and the second relationship is the relationship between the real pedestrian flow data corresponding to at least two preset points.
[0130] The first relation can be used to represent the distribution of the initial pixel values corresponding to at least two real pedestrian flow heatmaps, and the second relation can be used to represent the distribution of real pedestrian flow data corresponding to at least two preset points.
[0131] Specifically, if the first relationship matches the second relationship, it means that the distribution of the initial pixel values corresponding to at least two of the real pedestrian flow heat maps is consistent with the distribution of the real pedestrian flow data corresponding to at least two preset points. In this case, it can be considered that the pixel values calculated according to the initial weight coefficient have a certain relationship with the pedestrian flow data.
[0132] In one possible implementation, at least two of the real pedestrian flow heatmaps are obtained by collecting data from the same preset location at at least two different times. The step of determining whether the initial weight coefficients corresponding to each grayscale level meet preset conditions based on the initial pixel values of each of the real pedestrian flow heatmaps includes:
[0133] If the first relationship matches the third relationship, then the initial weight coefficients corresponding to each gray level are determined to meet the preset conditions. The third relationship is the relationship between the real pedestrian flow data corresponding to at least two time points.
[0134] The first relation can be used to represent the changing trend of the initial pixel values corresponding to at least two of the aforementioned real pedestrian flow heatmaps. The third relation can be used to represent the changing trend of the real pedestrian flow data corresponding to at least two different time points.
[0135] Specifically, if the first relationship matches the third relationship, it means that the changing trend of the initial pixel values corresponding to at least two of the real pedestrian flow heatmaps is consistent with the changing trend of the real pedestrian flow data corresponding to at least two different times. In this case, it can be considered that the pixel values calculated according to the initial weight coefficient have a certain relationship with the pedestrian flow data.
[0136] In one possible implementation, if the real pedestrian flow heatmap includes at least two first real pedestrian flow heatmaps obtained by collecting data from at least two preset locations, and the real pedestrian flow heatmap also includes at least two second real pedestrian flow heatmaps obtained by collecting data from the same preset location at at least two different times, then determining whether the initial weight coefficient corresponding to each grayscale value satisfies the preset conditions based on the initial pixel values of each of the real pedestrian flow heatmaps includes:
[0137] If the first relation matches the second relation and the first relation matches the third relation, then the initial weight coefficients corresponding to each gray level are determined to meet the preset conditions.
[0138] It is understood that the technical solution of this embodiment determines whether the initial weight coefficient corresponding to each grayscale meets the preset conditions by jointly using at least two first real pedestrian flow heat maps obtained from at least two preset locations and at least two second real pedestrian flow heat maps obtained from the same preset location at at least two times. That is, by jointly using at least two first real pedestrian flow heat maps obtained from at least two preset locations and at least two second real pedestrian flow heat maps obtained from the same preset location at at least two times, the target weight coefficient can be determined, thereby improving the accuracy of pedestrian flow data identification.
[0139] In one possible implementation, determining the target pedestrian flow data at the preset location based on the target pixel value includes:
[0140] Obtain the correspondence between pixel values and pedestrian flow data, wherein the correspondence is determined under the condition that the initial weight coefficients corresponding to each gray level meet preset conditions;
[0141] Based on the correspondence, the pedestrian flow data corresponding to the target pixel value is taken as the target pedestrian flow data.
[0142] The correspondence is used to represent the relationship between pixel values and pedestrian flow data, such as a functional relationship, which is not limited here. In this embodiment, since the correspondence is determined under the condition that the initial weight coefficients corresponding to each gray level meet the preset conditions, the correspondence is accurate. Therefore, the pedestrian flow data corresponding to the target pixel value can be determined based on the correspondence, and the pedestrian flow data corresponding to the target pixel value can be used as the target pedestrian flow data.
[0143] The technical solution of this embodiment obtains the correspondence between pixel values and pedestrian flow data, wherein the correspondence is determined under the condition that the initial weight coefficients corresponding to each gray level meet preset conditions; according to the correspondence, the pedestrian flow data corresponding to the target pixel value is taken as the target pedestrian flow data. Since the target pedestrian flow data can be determined through the correspondence, and the correspondence is determined under the condition that the initial weight coefficients corresponding to each gray level meet preset conditions, the target pedestrian flow data can be determined accurately and simply.
[0144] Please see Figure 2 , Figure 2 This is a flowchart illustrating a training method for a pedestrian flow data recognition model disclosed in an embodiment of the present invention. The training method for the pedestrian flow data recognition model in this embodiment can be applied to a training device for the pedestrian flow data recognition model. The training device can be a terminal, a server, or a processor with data processing capabilities, such as a chip, etc., and is not limited thereto. Figure 2 As shown, the training method for the pedestrian flow data recognition model in this embodiment includes:
[0145] Step 210: Obtain the real pedestrian flow heat map and the second spatiotemporal data matrix at the preset locations.
[0146] Step 220: Input the real pedestrian flow heat map and the second spatiotemporal data matrix into the generative adversarial network for training to obtain a trained pedestrian flow data recognition model. The pedestrian flow data recognition model is used to identify the target pedestrian flow data at the preset location.
[0147] The method by which the pedestrian flow data recognition model identifies the target pedestrian flow data can be referred to the description of any of the above embodiments, and will not be repeated here.
[0148] The technical solution of this embodiment obtains a real pedestrian flow heat map and a second spatiotemporal data matrix at preset locations, inputs the real pedestrian flow heat map and the second spatiotemporal data matrix into a generative adversarial network for training, and obtains a trained pedestrian flow data recognition model. The pedestrian flow data recognition model is used to identify the target pedestrian flow data at the preset locations. In other words, the target pedestrian flow data can be determined through the model, which can reduce manual intervention and improve the efficiency and convenience of pedestrian flow statistics.
[0149] In one possible implementation, the generative adversarial network includes a generator and a discriminator. The step of inputting the real pedestrian flow heatmap and the second spatiotemporal data matrix into the generative adversarial network for training to obtain a trained pedestrian flow data recognition model includes:
[0150] The second spatiotemporal data matrix is input into the generator to obtain the heat map of pedestrian flow to be determined;
[0151] The heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow are input into the discriminator to obtain the identification loss between the heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow. The identification loss is used to represent the similarity between the heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow.
[0152] If the recognition loss is less than or equal to the loss threshold, then the training of the pedestrian flow data recognition model is considered complete.
[0153] If the recognition loss is greater than the loss threshold, a new heatmap of pedestrian flow to be judged is generated by the generator, and the recognition loss between the new heatmap of pedestrian flow to be judged and the real heatmap of pedestrian flow is obtained by the discriminator.
[0154] The loss threshold can be set as needed and is not limited here. In this embodiment, the loss threshold is used to indicate whether the training accuracy of the model has reached the required level. Specifically, the generator processes the second spatiotemporal data matrix to obtain a pedestrian flow heatmap to be judged. The discriminator judges the recognition loss between the pedestrian flow heatmap to be judged and the real pedestrian flow heatmap. If the recognition loss is less than or equal to the loss threshold, it means that the model training has reached the required level, and it can be determined that the pedestrian flow data recognition model training is complete, so that pedestrian flow data can be identified by the model. If the recognition loss is greater than the loss threshold, it means that the accuracy is insufficient and training needs to continue. Then, the generator generates a new pedestrian flow heatmap to be judged, and the discriminator obtains the recognition loss between the new pedestrian flow heatmap to be judged and the real pedestrian flow heatmap, until the recognition loss is less than or equal to the loss threshold.
[0155] In one possible implementation, before inputting the real pedestrian flow heatmap and the second spatiotemporal data matrix into the generative adversarial network for training, the method further includes:
[0156] Obtain the original layer of the preset points;
[0157] The heat map of real pedestrian flow is processed by removing redundant information based on the original layer of the preset points to obtain the heat map of real pedestrian flow after removing redundant information.
[0158] The step of inputting the real pedestrian flow heatmap and the second spatiotemporal data matrix into the generative adversarial network for training includes:
[0159] The heat map of real pedestrian flow after removing redundant information and the second spatiotemporal data matrix are input into the generative adversarial network for training.
[0160] Redundant information refers to information irrelevant to pedestrian flow data identification; that is, it is interference information that affects the accuracy of pedestrian flow identification and increases the burden of model training. Optionally, redundant information includes, but is not limited to, Chinese characters, landmark symbols, etc. Redundant information removal processes include, but are not limited to, image subtraction, image channel format conversion, and erosion / dilation techniques.
[0161] The technical solution of this embodiment obtains the original layer of the preset points; performs redundant information removal processing on the real pedestrian flow heat map based on the original layer of the preset points to obtain the real pedestrian flow heat map after redundant information removal processing; and then inputs the real pedestrian flow heat map after redundant information removal processing and the second spatiotemporal data matrix into the generative adversarial network for training, thereby improving the accuracy of pedestrian flow recognition and reducing the burden of model training.
[0162] Please see Figure 3 , Figure 3 This is a schematic diagram of a framework for identifying pedestrian flow data according to an embodiment of the present invention. This embodiment is described in conjunction with the model training and data processing scenarios. Please refer to... Figure 3 The framework for pedestrian flow data recognition in this embodiment includes a data processing part and a model processing part.
[0163] The data processing section is mainly responsible for the collection and processing of information from "human flow heat map acquisition", "heat map preprocessing", "heat map passenger flow verification and comparison" and "spatiotemporal data matrix".
[0164] "Population Heatmap Acquisition": A 24-hour map population heatmap (real population heatmap) is captured from a specific area (preset location) via a virtual server. Throughout the acquisition process, the resolution of the heatmap remains consistent. The captured real population heatmap includes 7 shades of gray. Each shade of gray in the captured real population heatmap is initially weighted (the smaller the gray value, the darker the color, the larger the weight, and the denser the population). The weighted sum is then used to represent the population distribution at that location on that day. Since a denser population distribution means a smaller gray value and a darker color, the weighted sum can be used to visually compare the population distribution with surrounding locations.
[0165] "Heatmap Preprocessing": Because the obtained real pedestrian flow heatmap contains a large amount of redundant information such as Chinese characters and landmark symbols, in addition to the real pedestrian flow heatmap of the preset location, the original map layer of the preset location is also obtained during the collection process. Through image subtraction, image channel format conversion, and erosion and dilation, pixel-level hierarchical segmentation is performed to obtain a clean real pedestrian flow heatmap with only 7 gray levels. Then, "heatmap passenger flow verification and comparison" is performed through a third-party data source to determine the correspondence between pixel values and pedestrian flow quantity or index. The correspondence here refers to the preliminary weight initialization of the 7 gray levels, and the weighted sum is used as the estimated pedestrian flow value of the location. This is then compared vertically with the obtained pedestrian flow value (comparing whether the trend of the estimated value of different locations is consistent with the trend of the actual value; if they are consistent, it can be considered that there is a correspondence between the heatmap and the actual data).
[0166] "Spatiotemporal Data Matrix": Utilizing data mining and feature engineering, spatiotemporal data is rapidly extracted from a specific point radius or grid from a data acquisition interface. (Currently, the spatiotemporal data used primarily refers to human-field features centered at the point with a 500-meter radius, totaling 478 dimensions. The processing method mainly involves statistical calculations based on the raw data from the POI points.) This data is then preprocessed into a fixed-dimensional data matrix as input for subsequent models. The advantage of using this method to construct the input is that it allows for the selection of relatively easy-to-collect and representative spatiotemporal data (scene information and multi-party flow data) for feature construction, depending on the acquisition difficulty.
[0167] The model processing section is the core of the entire pedestrian flow data calibration model, mainly consisting of a "deconvolution-based generator" and a "convolution-based discriminator." This scheme uses a generative adversarial network (GAN) based on the original GAN model structure, replacing the fully connected network with a convolutional neural network to generate pseudo-pedestrian flow heatmaps and distinguish between real and fake pedestrian flow heatmaps. At the end of the training process, the generator and discriminator should maintain balance and eventually converge. The generator should be able to generate heatmaps that match the real pedestrian flow data. Figure 1The generator generates a pseudo-human flow heatmap (target human flow heatmap), while the discriminator can distinguish between real and fake human flow heatmaps. The graph convolutional model leverages its powerful feature extraction capabilities to better capture the distribution relationship between the "spatiotemporal data matrix" and the real human flow heatmap. Through zero-sum game training between the generator and discriminator, a generative adversarial network in equilibrium is obtained. Finally, the trained generator is used as the human flow heatmap generation model to generate human flow heatmaps for the required locations and convert them into human flow values or human flow indices.
[0168] Example 2
[0169] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of a pedestrian flow data identification device disclosed in an embodiment of the present invention. Figure 4 As shown, the pedestrian flow data identification device in this embodiment includes a first acquisition module 410, an input module 420, and a pedestrian flow data identification module 430, wherein:
[0170] The first acquisition module 410 is used to acquire the first spatiotemporal data matrix of the preset points;
[0171] The input module 420 is used to input the first spatiotemporal data matrix into the trained pedestrian flow data recognition model to obtain the target pedestrian flow heat map of the preset location. The pedestrian flow data recognition model is trained by inputting the second spatiotemporal data matrix of the preset location and the real pedestrian flow heat map into a generative adversarial network.
[0172] The pedestrian flow data identification module 430 is used to determine the target pedestrian flow data of the preset point based on the target pedestrian flow heat map.
[0173] In one possible implementation, the target pedestrian flow heatmap includes a plurality of first pixels, each of which has at least two grayscale levels, and each grayscale level is configured with a target weight coefficient. The pedestrian flow data recognition module 430 includes:
[0174] A pixel value determination unit is used to determine the target pixel value of the target pedestrian flow heat map based on the gray level of each first pixel and the target weight coefficient corresponding to each gray level, wherein the target pixel value is positively correlated with the first target product corresponding to each first pixel, and the first target product is the product between the gray level of the first pixel and the target weight coefficient corresponding to the gray level;
[0175] A pedestrian flow data identification unit is used to determine the target pedestrian flow data of the preset point based on the target pixel value.
[0176] In one possible implementation, the device further includes:
[0177] The weight coefficient determination module is used to acquire at least two real pedestrian flow heat maps, each of which includes multiple second pixels, and the multiple second pixels have at least two gray levels;
[0178] Configure the initial weight coefficients for each grayscale level;
[0179] Based on the grayscale of each second pixel in each of the real pedestrian flow heatmaps and the initial weight coefficient corresponding to each grayscale, the initial pixel value of each of the real pedestrian flow heatmaps is determined, wherein the initial pixel value is positively correlated with the second target product corresponding to each second pixel, and the second target product is the product between the grayscale of the second pixel and the initial weight coefficient corresponding to the grayscale.
[0180] Determine whether the initial weight coefficients corresponding to each grayscale level meet the preset conditions based on the initial pixel values of each of the real pedestrian flow heatmaps.
[0181] If the initial weight coefficients corresponding to each gray level meet the preset conditions, then the initial weight coefficients corresponding to each gray level will be used as the target weight coefficients corresponding to each gray level.
[0182] If the initial weight coefficients corresponding to each gray level do not meet the preset conditions, the steps for configuring the initial weight coefficients corresponding to each gray level will be repeated.
[0183] In one possible implementation, at least two of the real pedestrian flow heat maps are obtained by collecting data from at least two preset locations, and the weight coefficient determination module includes:
[0184] The first weight coefficient determination unit is used to determine that the initial weight coefficients corresponding to each gray level meet the preset conditions if the first relationship matches the second relationship. The first relationship is the relationship between the initial pixel values corresponding to at least two real traffic heat maps, and the second relationship is the relationship between the real traffic data corresponding to at least two preset points.
[0185] And / or,
[0186] At least two of the aforementioned real pedestrian flow heatmaps were obtained by collecting data from the same preset location at at least two different times. The weighting coefficient determination module includes:
[0187] The second weight coefficient determination unit is used to determine that the initial weight coefficients corresponding to each gray level meet the preset conditions if the first relationship matches the third relationship. The third relationship is the relationship between the real traffic data corresponding to at least two time points.
[0188] In one possible implementation, the pedestrian flow data recognition unit is used to obtain the correspondence between pixel values and pedestrian flow data, wherein the correspondence is determined under the condition that the initial weight coefficients corresponding to each gray level meet preset conditions;
[0189] Based on the correspondence, the pedestrian flow data corresponding to the target pixel value is taken as the target pedestrian flow data.
[0190] It is understood that the apparatus of this embodiment can be described with reference to the method of any of the above embodiments, and will not be repeated here.
[0191] Example 3
[0192] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a training device for a pedestrian flow data recognition model disclosed in an embodiment of the present invention. Figure 5 As shown, the training device for the pedestrian flow data recognition model in this embodiment includes a second acquisition module 510 and a training module 520, wherein:
[0193] The second acquisition module 510 is used to acquire the real pedestrian flow heat map and the second spatiotemporal data matrix at preset locations.
[0194] The training module 520 is used to input the real pedestrian flow heat map and the second spatiotemporal data matrix into the generative adversarial network for training, so as to obtain a trained pedestrian flow data recognition model. The pedestrian flow data recognition model is used to identify the target pedestrian flow data at the preset location.
[0195] In one possible implementation, the generative adversarial network includes a generator and a discriminator, and the training module 520 is used to input the second spatiotemporal data matrix into the generator to obtain a heat map of pedestrian traffic to be discriminated.
[0196] The heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow are input into the discriminator to obtain the identification loss between the heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow. The identification loss is used to represent the similarity between the heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow.
[0197] If the recognition loss is less than or equal to the loss threshold, then the training of the pedestrian flow data recognition model is considered complete.
[0198] If the recognition loss is greater than the loss threshold, a new heatmap of pedestrian flow to be judged is generated by the generator, and the recognition loss between the new heatmap of pedestrian flow to be judged and the real heatmap of pedestrian flow is obtained by the discriminator.
[0199] In one possible implementation, the device further includes:
[0200] The removal module is used to obtain the original layer of the preset point;
[0201] The heat map of real pedestrian flow is processed by removing redundant information based on the original layer of the preset points to obtain the heat map of real pedestrian flow after removing redundant information.
[0202] The training module 520 is used to input the real pedestrian flow heat map after removing redundant information and the second spatiotemporal data matrix into the generative adversarial network for training.
[0203] It is understood that the apparatus of this embodiment can be described with reference to the method of any of the above embodiments, and will not be repeated here.
[0204] Example 4
[0205] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of another pedestrian flow data identification device disclosed in an embodiment of the present invention. For example... Figure 6 As shown, the device for identifying pedestrian flow data may include:
[0206] Memory 601 storing executable program code;
[0207] Processor 602 coupled to memory 601;
[0208] The processor 602 calls the executable program code stored in the memory 601 to execute the steps in the method for identifying pedestrian flow data described in Embodiment 1 of the present invention.
[0209] Example 5
[0210] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a training device for a pedestrian flow data recognition model disclosed in an embodiment of the present invention. For example... Figure 7 As shown, the training device for this pedestrian flow data recognition model may include:
[0211] Memory 701 storing executable program code;
[0212] Processor 702 coupled to memory 701;
[0213] The processor 702 calls the executable program code stored in the memory 701 to execute the steps in the method for identifying pedestrian flow data described in Embodiment 1 of the present invention.
[0214] Example 6
[0215] This invention discloses a computer-storable medium storing computer instructions, which, when invoked, execute the steps of the method described in Embodiment 1 of this invention.
[0216] Example 7
[0217] This invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform the steps of the method described in Embodiment 1.
[0218] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0219] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0220] Finally, it should be noted that the method for identifying pedestrian flow data, the method for training a pedestrian flow data identification model, and the apparatus disclosed in the embodiments of the present invention are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit it. Although the present invention 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 the present invention.
Claims
1. A method for identifying pedestrian flow data, characterized in that, The method includes: Obtain the first spatiotemporal data matrix of the preset points; The first spatiotemporal data matrix is input into the trained pedestrian flow data recognition model to obtain the target pedestrian flow heat map of the preset location. The pedestrian flow data recognition model is obtained by inputting the second spatiotemporal data matrix of the preset location and the real pedestrian flow heat map into a generative adversarial network for training. Determine the target pedestrian flow data for the preset points based on the target pedestrian flow heat map; The target pedestrian flow heatmap includes multiple first pixels, each having at least two grayscale levels, and each grayscale level is configured with a target weight coefficient. Determining the target pedestrian flow data for the preset location based on the target pedestrian flow heatmap includes: The target pixel value of the target pedestrian flow heatmap is determined based on the gray level of each first pixel and the target weight coefficient corresponding to each gray level. The target pixel value is positively correlated with the first target product corresponding to each first pixel. The first target product is the product between the gray level of the first pixel and the target weight coefficient corresponding to the gray level. The target pedestrian flow data for the preset location is determined based on the target pixel value; Furthermore, the method further includes: Obtain at least two real pedestrian flow heatmaps, each of which includes multiple second pixels, and the multiple second pixels have at least two grayscale values; Configure the initial weight coefficients for each grayscale level; Based on the grayscale of each second pixel in each of the real pedestrian flow heatmaps and the initial weight coefficient corresponding to each grayscale, the initial pixel value of each of the real pedestrian flow heatmaps is determined, wherein the initial pixel value is positively correlated with the second target product corresponding to each second pixel, and the second target product is the product between the grayscale of the second pixel and the initial weight coefficient corresponding to the grayscale. Determine whether the initial weight coefficients corresponding to each grayscale level meet the preset conditions based on the initial pixel values of each of the real pedestrian flow heatmaps. If the initial weight coefficients corresponding to each gray level meet the preset conditions, then the initial weight coefficients corresponding to each gray level will be used as the target weight coefficients corresponding to each gray level. If the initial weight coefficients corresponding to each gray level do not meet the preset conditions, the steps for configuring the initial weight coefficients corresponding to each gray level will be repeated.
2. The method according to claim 1, characterized in that, At least two of the aforementioned real pedestrian flow heatmaps are obtained by collecting data from at least two preset locations. The step of determining whether the initial weight coefficients corresponding to each grayscale level meet preset conditions based on the initial pixel values of each of the aforementioned real pedestrian flow heatmaps includes: If the first relationship matches the second relationship, then the initial weight coefficients corresponding to each gray level are determined to meet the preset conditions. The first relationship is the relationship between the initial pixel values corresponding to at least two real traffic heatmaps, and the second relationship is the relationship between the real traffic data corresponding to at least two preset points. And / or, At least two of the aforementioned real pedestrian flow heatmaps were obtained by collecting data from the same preset location at at least two different times. The step of determining whether the initial weight coefficients corresponding to each grayscale level meet preset conditions based on the initial pixel values of each of the aforementioned real pedestrian flow heatmaps includes: If the first relationship matches the third relationship, then the initial weight coefficients corresponding to each gray level are determined to meet the preset conditions. The third relationship is the relationship between the real pedestrian flow data corresponding to at least two time points.
3. The method according to claim 1 or 2, characterized in that, Determining the target pedestrian flow data at the preset location based on the target pixel value includes: Obtain the correspondence between pixel values and pedestrian flow data, wherein the correspondence is determined under the condition that the initial weight coefficients corresponding to each gray level meet preset conditions; Based on the correspondence, the pedestrian flow data corresponding to the target pixel value is taken as the target pedestrian flow data.
4. A training method for a pedestrian flow data recognition model, characterized in that, The method includes: Obtain real pedestrian flow heat maps and a second spatiotemporal data matrix at preset locations; The real pedestrian flow heat map and the second spatiotemporal data matrix are input into a generative adversarial network for training to obtain a trained pedestrian flow data recognition model. The pedestrian flow data recognition model is used to identify the target pedestrian flow data of the preset location based on the pedestrian flow data recognition method according to any one of claims 1-3.
5. The method according to claim 4, characterized in that, The generative adversarial network (GAN) includes a generator and a discriminator. The step of inputting the real pedestrian flow heatmap and the second spatiotemporal data matrix into the GAN for training to obtain a trained pedestrian flow data recognition model includes: The second spatiotemporal data matrix is input into the generator to obtain the heat map of pedestrian flow to be determined; The heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow are input into the discriminator to obtain the identification loss between the heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow. The identification loss is used to represent the similarity between the heatmap of pedestrian flow to be identified and the heatmap of actual pedestrian flow. If the recognition loss is less than or equal to the loss threshold, then the training of the pedestrian flow data recognition model is considered complete. If the recognition loss is greater than the loss threshold, a new heatmap of pedestrian flow to be judged is generated by the generator, and the recognition loss between the new heatmap of pedestrian flow to be judged and the real heatmap of pedestrian flow is obtained by the discriminator.
6. The method according to claim 4 or 5, characterized in that, Before inputting the real pedestrian flow heatmap and the second spatiotemporal data matrix into the generative adversarial network for training, the method further includes: Obtain the original layer of the preset points; The heat map of real pedestrian flow is processed by removing redundant information based on the original layer of the preset points to obtain the heat map of real pedestrian flow after removing redundant information. The step of inputting the real pedestrian flow heatmap and the second spatiotemporal data matrix into the generative adversarial network for training includes: The heat map of real pedestrian flow after removing redundant information and the second spatiotemporal data matrix are input into the generative adversarial network for training.
7. A device for identifying pedestrian flow data, characterized in that, The apparatus is used to perform the method for identifying pedestrian flow data as described in any one of claims 1-3; and the apparatus comprises: The first acquisition module is used to acquire the first spatiotemporal data matrix of the preset points; The input module is used to input the first spatiotemporal data matrix into the trained pedestrian flow data recognition model to obtain the target pedestrian flow heat map of the preset location. The pedestrian flow data recognition model is trained by inputting the second spatiotemporal data matrix of the preset location and the real pedestrian flow heat map into a generative adversarial network. The pedestrian flow data identification module is used to determine the target pedestrian flow data of the preset point based on the target pedestrian flow heat map.
8. A training device for a pedestrian flow data recognition model, characterized in that, The apparatus is used to perform the training method for the pedestrian flow data recognition model as described in any one of claims 4-6; and the apparatus comprises: The second acquisition module is used to acquire the real pedestrian flow heat map and the second spatiotemporal data matrix at preset locations; The training module is used to input the real pedestrian flow heat map and the second spatiotemporal data matrix into the generative adversarial network for training, so as to obtain a trained pedestrian flow data recognition model. The pedestrian flow data recognition model is used to identify the target pedestrian flow data of the preset location based on the pedestrian flow data recognition method as described in any one of claims 1-3.
Citation Information
Patent Citations
People flow density prediction method and device, computer device and readable medium
CN110245579A
Track people flow prediction method and system fused with spatio-temporal information
CN113240179A
Generative adversarial network-based crowd movement prediction method
CN115238589A
