Cognitive driving space behavior modeling method based on inverse reinforcement learning
By collecting behavioral and environmental data in public spaces and combining it with inverse reinforcement learning, a spatial-behavioral model reflecting visual, functional, and social cognition is constructed. This solves the problems of insufficient data collection and low model prediction accuracy in existing technologies, and achieves accurate prediction and mechanistic explanation of crowd behavior.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies in public space behavior research rely on manually collected data, which suffers from limited samples, large subjective biases, difficulty in dynamic updates, and traditional models that fail to reflect the multi-dimensional influences of visual cognition, functional cognition, and community interaction, resulting in limited model prediction accuracy.
Behavioral data is acquired through fixed-point video recording and computer vision methods, and spatial environment data is acquired by combining oblique photography and 3D reconstruction. The agent is trained using inverse reinforcement learning, and cognitive features are extracted based on visual field analysis, geometric measurement, and quantitative statistics to construct a spatial-behavioral model that reflects visual, functional, and social cognition.
It enables accurate prediction and mechanistic explanation of crowd behavior in public spaces, improves the model's fitting and explanatory power, and has predictive and generalization capabilities, supporting spatial design optimization and urban governance.
Smart Images

Figure CN121787224A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of urban behavior research technology, and in particular relates to a cognitive-driven spatial behavior modeling method based on inverse reinforcement learning. Background Technology
[0002] Urban development is shifting from simple incremental expansion to improving quality and content. In this process, public spaces, as crucial carriers of residents' daily activities and social interactions, are a major research focus, with efficient utilization and refined management being key areas of research. Currently, there is an advocacy for utilizing next-generation information technologies such as artificial intelligence, big data, and the Internet of Things to dynamically perceive and scientifically analyze urban operations and population behavior, supporting the optimization of public space design and the modernization of urban governance. However, existing technologies in public space behavior research primarily rely on questionnaires, traditional statistical analysis, and rule-driven simulation methods. On the one hand, questionnaires and observation methods rely on manual data collection, resulting in limited samples, significant subjective bias, and difficulty in dynamic updates. On the other hand, behavioral simulation methods based on fixed rules or social force models often only consider physical factors, failing to reflect the real-world impact mechanisms of visual cognition, functional cognition, and community interaction. Furthermore, existing technologies often remain at the surface level of behavioral data analysis, lacking in-depth analysis of the cognitive mechanisms behind individual decision-making, leading to limited model prediction accuracy and hindering the provision of strong support for spatial optimization and urban governance. Summary of the Invention
[0003] Purpose of the invention: The purpose of this invention is to provide a cognitive-driven spatial behavior modeling method based on inverse reinforcement learning. This invention achieves accurate prediction and mechanistic explanation of crowd behavior in public spaces.
[0004] Technical solution: To achieve the above objectives, the cognitive-driven spatial behavior modeling method of the present invention includes the following steps: (1) Select public space objects, extract the behavior data of the space objects through fixed-point video recording and computer vision methods, obtain the spatial environment data of the space objects through oblique photography, three-dimensional reconstruction and semantic segmentation methods, and collect the interest point data of the space objects through the geospatial data platform to form a spatial-behavior dataset including spatial data and behavior data; (2) Extract behavioral data from the spatial-behavioral dataset, set the starting position of the agent based on the starting and ending points of the trajectory of each agent; calculate the optimal path based on distance and time cost based on the spatial environment data, and use it as the baseline reference for the agent; define the actions that the initial agent can perform in the space based on the spatial grid cells in the spatial dataset, and calculate the action sequence of the individual in the real trajectory. (3) Based on the grid data in the spatial-behavior dataset, the spatial field data, functional facility data and community interaction data of each grid are extracted through field analysis, geometric measurement and statistical methods. The feature vectors of each grid in different directions and multi-scale ranges are integrated to form a feature vector set that affects the environmental cognitive features of the agent's actions. (4) Construct a behavior policy function based on the initial agent setting results to describe the agent's action selection method in different states; introduce reinforcement learning method, take environmental cognitive features as input to reward function, and train the agent; during the training process, compare the simulated action sequence with the optimal path as the baseline reference with the real action sequence, and adjust the reward function parameters according to the difference; repeat the iteration until the reward function converges, output the final reward function and the corresponding behavior policy function, and obtain the spatial behavior prediction model; (5) Based on the convergent reward function, calculate the weight contribution of visual features, functional features and social features in the reward function respectively, determine the cognitive composition features and explanatory power of the spatial sample; at the same time, identify highly correlated feature-action combinations, and determine the direction of influence of different cognitive contents on behavior in the spatial sample. (6) Spatial data, behavioral data, environmental cognitive features, reward function parameters and behavioral mechanism analysis results are uniformly stored in the database to form a searchable spatial-behavioral dataset, and cognitive feature distribution map, behavioral prediction result map and mechanism analysis heat map are generated through visualization technology.
[0005] Optionally, the spatial-behavioral dataset in step (1) includes a spatial dataset and a behavioral dataset. The spatial dataset consists of spatial grid data, point of interest data, and facility element data. The spatial grid scale is 1m×1m. The point of interest data includes seven types: catering services, shopping services, financial services, living services, leisure services, medical and health services, and science, education, and culture services. The facility element data includes four types: rest service facilities, exhibition service facilities, entertainment service facilities, and transportation service facilities.
[0006] Optionally, the behavior dataset in step (1) consists of a set of trajectory points. Each trajectory point includes an individual ID, a frame ID, coordinate values, and an interaction status. The interaction status includes four types: no interaction, staying, talking, and multiple people gathering.
[0007] Optionally, the step (2) of calculating the optimal path based on distance and time cost based on spatial environment data as the baseline reference of the agent specifically involves: using the A* algorithm to iteratively select the node with the minimum total distance and time cost and expanding it; using a heuristic function to calculate the estimated cost of the target node until the destination node is found; backtracking to obtain the optimal path from the starting point to the destination; and then using a social force model for correction. The social force model includes target attraction, inter-individual repulsion, and environmental constraints. Combined with the path search algorithm based on distance and time cost, the baseline reference path of the agent is obtained.
[0008] Optionally, defining the actions that the agent can execute in space in step (2) refers to defining the set of actions that the agent can execute in any given grid. , Based on the individual's actual trajectory, the trajectory path is converted into a corresponding action sequence; for a given actual trajectory, the actual trajectory is converted into a state sequence consisting of a series of grid center coordinates. Calculate the difference vector between adjacent states. Based on the predefined mapping relationship between movement direction and action, the difference vector is converted into the corresponding action label, ultimately forming an action sequence. .
[0009] Optionally, step (3) of extracting spatial view data, functional facility data, and community interaction data for each grid using view analysis, geometric measurement, and statistical methods specifically includes the following steps: First, spatial view domain data for each grid is extracted through view domain analysis. Using the view domain analysis method, a view domain based on a planar view is constructed with the grid center as the observation point. Then, the view domain integration degree is calculated using Depthmap software. The calculation method is as follows: , in, Represents a grid Visual integration degree; It represents the set of all grids in the entire space system; Total number of grid cells; Indicates from grid To grid The shortest path length; by normalizing the calculation results of the view integration degree, the standardized view integration degree value corresponding to each grid is obtained; Secondly, functional facility data for each grid is extracted using geometric measurement and statistical methods. First, calculate the number of various functional facilities it contains. The calculation formula is as follows: , in, Represents a grid Internal category The number of facilities Indicates the first Facilities, Category Includes 7 types of points of interest. For logical discrimination functions, when the facility Category And fall on the grid The value is 1 if the time interval is within the grid, and 0 otherwise; then calculate the number of facility elements within the grid, using the following formula: , in, Represents a grid Internal belonging to the element type Quantity, Indicates the first Each facility element, element type This includes four types of facility element data; then, the contact length between the grid boundary and the facility interface is calculated using the following formula: , in, Represents a grid The total length in contact with the facility interface, This represents the set of edges adjacent to the facility on the grid boundary. Representing an edge The length; in order to unify the three types of indicators—the number of functional facilities, the number of facility elements, and the interface contact length—into a comprehensive feature of functional facilities in the grid, a comprehensive value for functional facilities is defined. for: , in, , , Let be the weighting coefficient, satisfying This is used to balance the relative contributions of the number of functional facilities, the number of facility elements, and the interface contact length to the overall characteristics. Finally, community interaction data for each grid was extracted using statistical methods, and each grid unit was recorded frame by frame based on trajectory points. The occurrence of behavior within; defining the first Interactive behaviors in grid cells The frequency of occurrence within a unit of time is: , in, Indicates category In the grid The average frame rate in Indicates at time State within the grid The number of actions, The total number of frames within the observation time window. There are four types of interaction; the intensity of interaction is defined. The cumulative effect of this behavior in the grid is represented by the following calculation method: , in, For in the grid The internally detected category The number of interactive events Indicates the first The number of frames lasting each event. This represents the number of participating individuals; the product of these two values constitutes the intensity value of a single event. To form a unified characteristic index for community interaction, a comprehensive community interaction value is defined. The frequency and intensity of various behaviors are weighted and fused together, as shown in the following expression: , in, , Categories The frequency and intensity fusion weight parameter is used to regulate the influence of different interactive behaviors on the overall community interaction, satisfying... Community Interaction Overall Value As a community perception feature input for grids in cognitive modeling, it is used to characterize the activity and interaction complexity of group behavior within the space.
[0010] Optionally, step (3) of integrating the feature vectors of each grid across multiple scales in different directions specifically includes the following steps: Using the grid center as a reference, the space is divided into four directional regions: east, south, west, and north. Each direction covers a fan-shaped area within a 90° range. Three analysis scales are set: 1m, 5m, and 10m. Expanding outward from the grid center, a set of neighboring grids within the included area is obtained. For each scale and direction's neighboring area, the corresponding spatial view indexes are statistically analyzed. Functional facilities indicators Community interaction metrics The calculation method for each indicator is based on the average value of the neighborhood grid. The functional facility indicators are expressed as follows: , in, Indicated by grid Centered on, scale is , direction is The neighborhood grid set, Indicates the number of neighboring grid cells. Neighborhood grid The functional facility value; similarly, the spatial horizon index and community interaction index are also calculated using the average value within the neighborhood, thus integrating characteristics at different scales and directions; the scale set is The direction set is Then the final high-dimensional feature vector of each grid can be expressed as: , in , , Representing the scale respectively ,direction Lower grid Spatial horizon indicators, functional facility indicators, and community interaction indicators.
[0011] Optionally, the construction of the behavior policy function based on the initial agent setting results in step (4) specifically refers to: First, the agent's current position is compared with its corresponding environmental perception feature vector. Together they form a state m∈M, and an action a∈A comes from the finite set of actions defined in step (2); Next, define the policy function. Let represent the probability that the agent chooses action a in state m: , in, The state of the agent. For actions in the finite set of actions defined in step (2), This is the action value function.
[0012] Optionally, the reward function in step (4) is defined as: , in, , , which is the environmental cognitive feature vector of the state.
[0013] Optionally, in step (4), the simulated action sequence with the optimal path as the baseline reference is compared with the real action sequence, and the reward function parameters are adjusted according to the differences; the iteration is repeated until the reward function converges, and the final reward function and the corresponding behavior policy function are output to obtain the spatial behavior prediction model. The specific steps are as follows: First, the function is constructed using the maximum entropy inverse reinforcement learning method: , in, Let D be the actual trajectory, and D be the trajectory dataset. For the weight parameters to be optimized, the trajectory probability is modeled as follows: , in, As the normalization factor, In the state The reward function obtained from the state; Secondly, update the parameters using gradient descent. Observe the difference in feature expectations between the real trajectory and the model-generated trajectory to correct the reward function; Meanwhile, during the optimization and correction process, a double comparison is introduced. The first comparison is between the real trajectory and the simulated trajectory to ensure that the distribution of the generated trajectory approximates the real distribution. The second comparison is between the real trajectory and the baseline path: the optimal path calculated in step (2) is used as a rational reference, and the weight of the reward function is corrected through the trajectory difference. The trajectory difference is the edit distance. Finally, when the trajectory distribution difference is below a threshold, the reward function is determined to be converged; the output includes the converged reward function parameters, the action selection policy function, and the spatial behavior prediction model based on the reward function parameters and function.
[0014] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: (1) This invention introduces video trajectory and spatial environment data, combines optimal path baseline setting and inverse reinforcement learning training to form a spatial-behavioral model that can reflect visual cognition, functional cognition and community cognition, and realizes accurate prediction and mechanistic explanation of crowd behavior in public spaces. (2) This invention can simultaneously obtain high-precision behavioral trajectory data and spatial environment data by fusing multi-source data from video monitoring, 3D reconstruction and geospatial platform, ensuring the authenticity, continuity and integrity of the data, and laying the data foundation for spatial behavior modeling; (3) Before modeling, the present invention sets the initial agent based on the real dataset, standardizes the spatial entry and exit points, and introduces the optimal path based on distance and time as the reference path. At the same time, the spatial environment is gridded to clarify the action space, which can ensure that the agent's motion logic is consistent with the real behavior and improve the model's fitting ability. (4) This invention analyzes the behavior mechanism of public space from the perspective of cognition, extracts visual features, functional facility features and community interaction features as environmental cognitive elements, and maps them to the spatial grid in a multi-scale manner, which can comprehensively depict the visual preferences, functional needs and group interaction effects in public space, and improve the input diversity of the model and the explanatory power of complex behaviors. (5) This invention introduces an inverse reinforcement learning method for behavior modeling. By comparing the real trajectory with the baseline path, the reward function is automatically learned. This method can quantify the relationship between cognitive elements and behavioral decisions in the form of weights, achieve interpretability of results, and have predictive and generalization capabilities. This avoids the limitations of traditional rule models that rely on human assumptions, and improves the lack of interpretability of black box models. (6) This invention establishes a unified data storage and visualization platform, which manages spatial data, behavioral data, cognitive features, reward function parameters and mechanism analysis results in a structured manner, and displays them in the form of heat maps, path prediction maps, element contribution maps, etc., which can intuitively present spatial behavior patterns and facilitate spatial design optimization and decision support. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the structure of the present invention. Detailed Implementation
[0016] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0017] like Figure 1 As shown, the present invention provides a cognitive-driven spatial behavior modeling method based on inverse reinforcement learning, comprising the following steps: (1) Spatial behavior data acquisition Public space objects are selected, and behavioral data of the spatial objects are extracted through fixed-point video recording and computer vision methods. Spatial environment data of the spatial objects are obtained through oblique photography, 3D reconstruction and semantic segmentation methods. Interest point data of the spatial objects are collected through a geospatial data platform to form a spatial-behavioral dataset that includes spatial data and behavioral data.
[0018] The spatial-behavioral dataset includes a spatial dataset and a behavioral dataset. The spatial dataset consists of spatial grid data, points of interest (POI) data, and facility element data. The spatial grid has a scale of 1m×1m. The POI data includes seven types: catering services, shopping services, financial services, living services, leisure services, medical and health services, and science, education, and culture services. The facility element data includes four types: rest service facilities, exhibition service facilities, entertainment service facilities, and transportation service facilities. The behavioral dataset consists of a set of trajectory points. Each trajectory point contains an individual ID, frame ID, coordinate value, and interaction status. The interaction status includes four types: no interaction, staying, talking, and multiple people gathering.
[0019] (2) Initial agent setting Extract behavioral data from the spatial-behavioral dataset, set the starting position of each agent based on the trajectory start and end points, calculate the optimal path based on distance and time cost based on spatial environment data, and use it as the baseline reference for the agent, define the actions that the agent can perform in space based on the spatial grid cells in the spatial dataset, and calculate the action sequence of the individual in the real trajectory.
[0020] The process involves setting the starting position of each agent based on its trajectory start and end points, with the starting point being designated as the agent's initial state. Set the endpoint as the agent's target state. .
[0021] The calculation of the optimal path based on distance and time cost, which serves as the baseline reference for the agent, based on spatial environment data, specifically involves: using the A* algorithm to iteratively select the node with the minimum total distance and time cost and expanding it; using a heuristic function to calculate the estimated cost of the target node until the destination node is found; and backtracking to obtain the optimal path from the starting point to the destination. Then, a social force model is used for correction. The social force model includes target attraction, inter-individual repulsion, and environmental constraints. Combined with the path search algorithm based on distance and time cost, the baseline reference path for the agent is obtained.
[0022] The actions that an agent can perform in space are defined as the set of actions that an agent can perform in any given grid. , Based on the individual's actual trajectory, the trajectory path is converted into a corresponding action sequence; for a given actual trajectory, it is converted into a state sequence consisting of a series of grid center coordinates. Calculate the difference vector between adjacent states. Based on the predefined mapping relationship between movement direction and action, the difference vector is converted into the corresponding action label, ultimately forming an action sequence. .
[0023] (3) Extraction of environmental cognitive features Based on grid-based data in the spatial-behavioral dataset, spatial view data, functional facility data, and community interaction data for each grid are extracted through view analysis, geometric measurement, and statistical methods. Feature vectors in different directions and at multiple scales are integrated for each grid to form a set of feature vectors that influence the environmental cognitive features of the agent's actions, which serves as the input basis for the reinforcement learning reward function.
[0024] The extraction of spatial view data, functional facility data, and community interaction data for each grid through view analysis, geometric measurement, and statistical methods specifically includes the following steps: First, spatial view domain data for each grid is extracted through view domain analysis. Using the view domain analysis method, a view domain based on a planar view is constructed with the grid center as the observation point. Then, the view domain integration degree is calculated using Depthmap software. The calculation method is as follows: , in, Represents a grid Visual integration degree; It represents the set of all grids in the entire space system; Total number of grid cells; Indicates from grid To grid The shortest path length; by normalizing the calculation results of the view integration degree, the standardized view integration degree value corresponding to each grid is obtained; Secondly, functional facility data for each grid is extracted using geometric measurement and statistical methods. First, calculate the number of various functional facilities it contains. The calculation formula is as follows: , in, Represents a grid Internal category The number of facilities Indicates the first Facilities, Category Includes 7 types of points of interest. For logical discrimination functions, when the facility Category And fall on the grid The value is 1 if the time interval is within the grid, and 0 otherwise; then calculate the number of facility elements within the grid, using the following formula: , in, Represents a grid Internal belonging to the element type Quantity, Indicates the first Each facility element, element type This includes four types of facility element data; then, the contact length between the grid boundary and the facility interface is calculated using the following formula: , in, Represents a grid The total length in contact with the facility interface, This represents the set of edges adjacent to the facility on the grid boundary. Representing an edge The length; in order to unify the three types of indicators—the number of functional facilities, the number of facility elements, and the interface contact length—into a comprehensive feature of functional facilities in the grid, a comprehensive value for functional facilities is defined. for: , in, , , Let be the weighting coefficient, satisfying This is used to balance the relative contributions of the number of functional facilities, the number of facility elements, and the interface contact length to the overall characteristics. Finally, community interaction data for each grid was extracted using statistical methods, and each grid unit was recorded frame by frame based on trajectory points. The occurrence of behavior within; defining the first Interactive behaviors in grid cells The frequency of occurrence within a unit of time is: , in, Indicates category In the grid The average frame rate in Indicates at time State within the grid The number of actions, The total number of frames within the observation time window. There are four types of interaction; the intensity of interaction is defined. The cumulative effect of this behavior in the grid is represented by the following calculation method: , in, For in the grid The internally detected category The number of interactive events Indicates the first The number of frames lasting each event. This represents the number of participating individuals; the product of these two values constitutes the intensity value of a single event. To form a unified characteristic index for community interaction, a comprehensive community interaction value is defined. The frequency and intensity of various behaviors are weighted and fused together, as shown in the following expression: , in, , Categories The frequency and intensity fusion weight parameter is used to regulate the influence of different interactive behaviors on the overall community interaction, satisfying... Community Interaction Overall Value As a community perception feature input for grids in cognitive modeling, it is used to characterize the activity and interaction complexity of group behavior within the space.
[0025] The process of integrating the feature vectors of each grid across multiple scales in different directions specifically includes the following steps: Using the grid center as a reference, the space is divided into four directional regions: east, south, west, and north. Each direction covers a fan-shaped area within a 90° range. Three analysis scales are set: 1m, 5m, and 10m. Expanding outward from the grid center, a set of neighboring grids within the included area is obtained. For each scale and direction's neighboring area, the corresponding spatial view indexes are statistically analyzed. Functional facilities indicators Community interaction metrics The calculation method for each indicator is based on the average value of the neighborhood grid. The functional facility indicators are expressed as follows: , in, Indicated by grid Centered on, scale is , direction is The neighborhood grid set, Indicates the number of neighboring grid cells. Neighborhood grid The functional facility value; similarly, the spatial horizon index and community interaction index are also calculated using the average value within the neighborhood, thus integrating characteristics at different scales and directions; the scale set is The direction set is Then the final high-dimensional feature vector of each grid can be expressed as: , in , , Representing the scale respectively ,direction Lower grid Spatial horizon indicators, functional facility indicators, and community interaction indicators.
[0026] (4) Spatial behavior modeling Based on the initial agent settings, a behavior policy function is constructed to describe the agent's action selection methods under different states. A reinforcement learning method is introduced, using environmental cognitive features as input to the reward function to train the agent. During training, the simulated action sequence with the optimal path as the baseline is compared with the real action sequence, and the reward function parameters are adjusted according to the differences. The process is repeated iteratively until the reward function converges, and the final reward function and the corresponding behavior policy function are output to obtain the spatial behavior prediction model.
[0027] The specific method for constructing the behavior policy function based on the initial agent settings is as follows: First, the agent's current position is compared with its corresponding environmental perception feature vector. Together they form a state m∈M, and an action a∈A comes from the finite set of actions defined in step (2); Next, define the policy function. Let represent the probability that the agent chooses action a in state m: , in, The state of the agent. For actions in the finite set of actions defined in step (2), This is the action value function.
[0028] The reward function is defined as follows: , in, , , which is the environmental cognitive feature vector of the state.
[0029] The specific steps for comparing the simulated action sequence with the real action sequence using the optimal path as a baseline reference, adjusting the reward function parameters based on the differences, and iterating repeatedly until the reward function converges, are as follows: The final reward function and the corresponding behavior policy function are then output to obtain the spatial behavior prediction model. First, the function is constructed using the maximum entropy inverse reinforcement learning method: , in, Let D be the actual trajectory, and D be the trajectory dataset. For the weight parameters to be optimized, the trajectory probability is modeled as follows: , in, As the normalization factor, In the state The reward function obtained from the state; Secondly, update the parameters using gradient descent. Observe the difference in feature expectations between the real trajectory and the model-generated trajectory to correct the reward function; Meanwhile, during the optimization and correction process, a double comparison is introduced. The first comparison is between the real trajectory and the simulated trajectory to ensure that the distribution of the generated trajectory approximates the real distribution. The second comparison is between the real trajectory and the baseline path: the optimal path calculated in step (2) is used as a rational reference, and the weight of the reward function is corrected through the trajectory difference. The trajectory difference is the edit distance. Finally, when the trajectory distribution difference is below a threshold, the reward function is determined to be converged; the output includes the converged reward function parameters, the action selection policy function, and the spatial behavior prediction model based on the reward function parameters and function.
[0030] (5) Analysis of behavioral mechanisms Based on a convergent reward function, the weight contributions of visual features, functional features, and social features in the reward function are calculated respectively to determine the cognitive composition features and explanatory power of the spatial sample; at the same time, highly correlated feature-action combinations are identified to determine the direction of influence of different cognitive contents on behavior in the spatial sample.
[0031] (6) Data database construction and visualization Spatial data, behavioral data, environmental cognitive features, reward function parameters, and behavioral mechanism analysis results are uniformly stored in the database to form a searchable spatial-behavioral dataset. Cognitive feature distribution maps, behavioral prediction result maps, and mechanism analysis heatmaps are generated through visualization technology for use in spatial optimization design, behavioral simulation, and decision support.
[0032] This invention introduces video trajectory and spatial environment data, and combines optimal path baseline setting with inverse reinforcement learning training to form a spatial-behavioral model that reflects visual cognition, functional cognition and social cognition. It can achieve accurate prediction and mechanistic explanation of crowd behavior in public spaces, and is applicable to application scenarios such as spatial design optimization, group behavior simulation and smart city management.
Claims
1. A cognitive-driven spatial behavior modeling method based on inverse reinforcement learning, characterized in that, Includes the following steps: (1) Select public space objects, extract the behavior data of the space objects through fixed-point video recording and computer vision methods, obtain the spatial environment data of the space objects through oblique photography, three-dimensional reconstruction and semantic segmentation methods, and collect the interest point data of the space objects through the geospatial data platform to form a spatial-behavior dataset including spatial data and behavior data; (2) Extract behavioral data from the spatial-behavioral dataset, and set the starting position of the agent based on the starting and ending points of the trajectory of each individual agent; The optimal path is calculated based on distance and time cost using spatial environment data, and serves as a baseline reference for the agent. Based on the spatial grid cells in the spatial dataset, define the actions that the initial agent can perform in space, and calculate the action sequence of the individual in the real trajectory; (3) Based on the grid data in the spatial-behavior dataset, the spatial field data, functional facility data and community interaction data of each grid are extracted through field analysis, geometric measurement and statistical methods. The feature vectors of each grid in different directions and multi-scale ranges are integrated to form a feature vector set that affects the environmental cognitive features of the agent's actions. (4) Construct a behavior policy function based on the initial agent setting results to describe the agent's action selection method in different states; introduce reinforcement learning method, use environmental cognitive features as input to the reward function, and train the agent; During training, the simulated action sequence with the optimal path as the baseline reference is compared with the real action sequence, and the reward function parameters are adjusted according to the differences. The process is repeated until the reward function converges, and the final reward function and the corresponding behavior policy function are output to obtain the spatial behavior prediction model. (5) Based on the convergent reward function, calculate the weight contribution of visual features, functional features and social features in the reward function respectively, determine the cognitive composition features and explanatory power of the spatial sample; at the same time, identify highly correlated feature-action combinations, and determine the direction of influence of different cognitive contents on behavior in the spatial sample. (6) Spatial data, behavioral data, environmental cognitive features, reward function parameters and behavioral mechanism analysis results are uniformly stored in the database to form a searchable spatial-behavioral dataset, and cognitive feature distribution map, behavioral prediction result map and mechanism analysis heat map are generated through visualization technology.
2. The cognitive-driven spatial behavior modeling method based on inverse reinforcement learning according to claim 1, characterized in that, The spatial-behavioral dataset mentioned in step (1) includes a spatial dataset and a behavioral dataset. The spatial dataset consists of spatial grid data, point of interest data, and facility element data. The spatial grid scale is 1m×1m. The point of interest data includes seven types: catering services, shopping services, financial services, living services, leisure services, medical and health care services, and science, education, and culture services. The facility element data includes four types: rest service facilities, exhibition service facilities, entertainment service facilities, and transportation service facilities.
3. The cognitive-driven spatial behavior modeling method based on inverse reinforcement learning according to claim 2, characterized in that, The behavior dataset in step (1) consists of a set of trajectory points. Each trajectory point contains an individual ID, a frame ID, coordinate values, and an interaction status. The interaction status includes four types: no interaction, staying, talking, and multiple people gathering.
4. The cognitive-driven spatial behavior modeling method based on inverse reinforcement learning according to claim 3, characterized in that, The step (2) of calculating the optimal path based on distance and time cost based on spatial environment data as the baseline reference of the agent is as follows: the A* algorithm is used to iteratively select the node with the minimum total distance and time cost and expand it, and the estimated cost of the target node is calculated using a heuristic function until the destination node is found, and the optimal path from the starting point to the destination is obtained by backtracking. The social force model is then used for correction. The social force model includes goal attraction, inter-individual repulsion, and environmental constraints. Combined with a path search algorithm based on distance and time cost, the baseline reference path of the agent is obtained.
5. The cognitive-driven spatial behavior modeling method based on inverse reinforcement learning according to claim 4, characterized in that, In step (2), defining the actions that an agent can perform in space refers to defining the set of actions that an agent can perform in any given grid. , Based on the individual's actual trajectory, the trajectory path is converted into a corresponding action sequence; for a given actual trajectory, the actual trajectory is converted into a state sequence consisting of a series of grid center coordinates. Calculate the difference vector between adjacent states. Based on the predefined mapping relationship between movement direction and action, the difference vector is converted into the corresponding action label, ultimately forming an action sequence. 。 6. The cognitive-driven spatial behavior modeling method based on inverse reinforcement learning according to claim 5, characterized in that, The step (3) described above, which involves extracting spatial view data, functional facility data, and community interaction data for each grid using view analysis, geometric measurement, and statistical methods, specifically includes the following steps: First, spatial view domain data for each grid is extracted through view domain analysis. Using the view domain analysis method, a view domain based on a planar view is constructed with the grid center as the observation point. Then, the view domain integration degree is calculated using Depthmap software. The calculation method is as follows: , in, Represents a grid Visual integration degree; It represents the set of all grids in the entire space system; Total number of grid cells; Indicates from grid To grid The shortest path length; by normalizing the calculation results of the view integration degree, the standardized view integration degree value corresponding to each grid is obtained; Secondly, functional facility data for each grid is extracted using geometric measurement and statistical methods. First, calculate the number of various functional facilities it contains. The calculation formula is as follows: , in, Represents a grid Internal category The number of facilities Indicates the first Facilities, Category Includes 7 types of points of interest. For logical discrimination functions, when the facility Category And fall on the grid The value is 1 if the time interval is within the grid, and 0 otherwise; then calculate the number of facility elements within the grid, using the following formula: , in, Represents a grid Internal belonging to the element type Quantity, Indicates the first Each facility element, element type This includes four types of facility element data; then, the contact length between the grid boundary and the facility interface is calculated using the following formula: , in, Represents a grid The total length in contact with the facility interface, This represents the set of edges adjacent to the facility on the grid boundary. Representing an edge The length; in order to unify the three types of indicators—the number of functional facilities, the number of facility elements, and the interface contact length—into a comprehensive feature of functional facilities in the grid, a comprehensive value for functional facilities is defined. for: , in, , , For the weighting coefficients, satisfying This is used to balance the relative contributions of the number of functional facilities, the number of facility elements, and the interface contact length to the overall characteristics. Finally, community interaction data for each grid was extracted using statistical methods, and each grid unit was recorded frame by frame based on trajectory points. The occurrence of behavior within; defining the first Interactive behaviors in grid cells The frequency of occurrence within a unit of time is: , in, Indicate category In the grid Average frame rate in Indicates at time State within the grid The number of actions, The total number of frames within the observation time window. There are four types of interaction; the intensity of interaction is defined. The cumulative effect of this behavior in the grid is represented by the following calculation method: , in, For in the grid The internally detected category The number of interactive events Indicates the first The number of frames lasting each event. This represents the number of participating individuals; the product of these two values constitutes the intensity value of a single event. To form a unified characteristic index for community interaction, a comprehensive community interaction value is defined. The frequency and intensity of various behaviors are weighted and fused together, as shown in the following expression: , in, , Categories The frequency and intensity fusion weight parameter is used to regulate the influence of different interactive behaviors on the overall community interaction, satisfying... Community Interaction Overall Value As a community perception feature input for grids in cognitive modeling, it is used to characterize the activity and interaction complexity of group behavior within the space.
7. The cognitive-driven spatial behavior modeling method based on inverse reinforcement learning according to claim 6, characterized in that, Step (3) of integrating the feature vectors of each grid across multiple scales in different directions specifically includes the following steps: Using the grid center as a reference, the space is divided into four directional regions: east, south, west, and north. Each direction covers a fan-shaped area within a 90° range. Three analysis scales are set: 1m, 5m, and 10m. Expanding outward from the grid center, a set of neighboring grids within the included area is obtained. For each scale and direction's neighboring area, the corresponding spatial view indexes are statistically analyzed. Functional facilities indicators Community interaction metrics The calculation method for each indicator is based on the average value of the neighborhood grid. The functional facility indicators are expressed as follows: , in, Indicated by grid Centered on, scale is , direction is The neighborhood grid set, Indicates the number of neighboring grid cells. Neighborhood grid The functional facility value; similarly, the spatial horizon index and community interaction index are also calculated using the average value within the neighborhood, thus integrating characteristics at different scales and directions; the scale set is The direction set is Then the final high-dimensional feature vector of each grid can be expressed as: , in , , Representing the scale respectively ,direction Lower grid Spatial horizon indicators, functional facility indicators, and community interaction indicators.
8. The cognitive-driven spatial behavior modeling method based on inverse reinforcement learning according to claim 7, characterized in that, The construction of the behavior policy function based on the initial agent setting results in step (4) is specifically as follows: First, the agent's current position is compared with its corresponding environmental perception feature vector. Together they form a state m∈M, and an action a∈A comes from the finite set of actions defined in step (2); Next, define the policy function. Let represent the probability that the agent chooses action a in state m: , in, The state of the agent. For actions in the finite set of actions defined in step (2), This is the action value function.
9. A cognitive-driven spatial behavior modeling method based on inverse reinforcement learning according to claim 8, characterized in that, The reward function in step (4) is defined as follows: , in, , , which is the environmental cognitive feature vector of the state.
10. A cognitive-driven spatial behavior modeling method based on inverse reinforcement learning according to claim 9, characterized in that, In step (4), the simulated action sequence with the optimal path as the baseline reference is compared with the real action sequence, and the reward function parameters are adjusted according to the differences. The iteration is repeated until the reward function converges, and the final reward function and the corresponding behavior policy function are output to obtain the spatial behavior prediction model. The specific steps are as follows: First, the function is constructed using the maximum entropy inverse reinforcement learning method: , in, Let D be the actual trajectory, and D be the trajectory dataset. For the weight parameters to be optimized, the trajectory probability is modeled as follows: , in, As the normalization factor, In the state The reward function obtained from the state; Secondly, parameters are updated via gradient descent. Observe the difference in feature expectations between the real trajectory and the model-generated trajectory to correct the reward function; Meanwhile, during the optimization and correction process, a double comparison is introduced. The first comparison is between the real trajectory and the simulated trajectory to ensure that the distribution of the generated trajectory approximates the real distribution. The second comparison is between the real trajectory and the baseline path: the optimal path calculated in step (2) is used as a rational reference, and the weight of the reward function is corrected through the trajectory difference. The trajectory difference is the edit distance. Finally, when the trajectory distribution difference is below a threshold, the reward function is determined to be converged; the output includes the converged reward function parameters, the action selection policy function, and the spatial behavior prediction model based on the reward function parameters and function.