Method and system for predicting grading of number of people in outdoor fitness activities

By constructing a prediction model for the number of outdoor fitness facilities using a random forest classification algorithm, the shortcomings of prediction of the number of outdoor fitness facilities in the existing technology are solved, and the results of accurate prediction and optimized allocation of facilities resources are achieved.

CN119740131APending Publication Date: 2025-04-01SOUTHEAST UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411892158.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The existing technology is difficult to achieve accurate prediction of the number of people using outdoor fitness facilities, resulting in uneven allocation of facilities resources, low utilization rates, and serious supply and demand contradictions.

Method used

By collecting and analyzing the use of outdoor fitness facilities and their surrounding environmental characteristics, a random forest classification algorithm is used to construct a prediction model to predict the grading of users in different time periods and population types.

Benefits of technology

It has achieved accurate prediction of the number of people who are outdoor fitness activities, improved the dynamic analysis ability of the facility usage level, enhanced the accurate grasp of the demand and usage of facilities, and supported the scientific planning and optimal resource allocation of urban fitness facilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119740131A_ABST
    Figure CN119740131A_ABST
Patent Text Reader

Abstract

The invention discloses an outdoor fitness activity people number grading prediction method and system, and relates to the technical field of landscape gardens, urban planning, public health services and artificial intelligence, and the method comprises the steps: receiving fitness facility related data, carrying out the data preprocessing based on the fitness facility related data in combination with one-hot codes, and obtaining an urban fitness facility database; dividing the urban fitness facility database into a training set and a test set, inputting the training set into a pre-established preliminary people number grading prediction model for training optimization, inputting the test set into the trained people number grading prediction model for testing, obtaining the trained and tested people number grading prediction model, obtaining a to-be-predicted region variable, and predicting the to-be-predicted region variable. Inputting the to-be-predicted region variable into the trained and tested people number grading prediction model, and outputting to obtain an active people number interval prediction result and a corresponding active people number grade; the method can accurately predict the number grade of facility users of different age groups in different time periods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the fields of landscape architecture, urban planning, public health services and artificial intelligence technology, and specifically to a method and system for grading prediction of the number of people participating in outdoor fitness activities. Background Art

[0002] With the acceleration of urbanization and the enhancement of residents' health awareness, the importance of public fitness facilities in modern urban planning has become increasingly prominent. However, due to limited land resources, the number and distribution of existing fitness facilities often cannot meet the rapidly growing diversified needs. There are problems such as uneven allocation of facility resources, low facility utilization, and lack of dynamic monitoring. There is a polarization phenomenon in which residents' access to fitness resources is limited or there is an oversupply of facilities and waste of resources. The imbalance between supply and demand makes it difficult to respond to residents' needs in a timely manner, which also limits the improvement of facility service efficiency. In addition, the demand for fitness facilities varies in different time periods and population types, but there is currently a lack of accurate prediction methods for the demand for fitness activities, which has led to an intensification of the contradiction between supply and demand of fitness facilities.

[0003] With the development of big data and machine learning technology, the fitness activity patterns of residents of different ages in different regions can be predicted more scientifically by analyzing the residents' fitness behavior data and the surrounding environment data of the facilities. However, the current research on the prediction of fitness facility usage patterns is mostly focused on large-scale macro statistics, lacking detailed prediction models for specific facilities and environments. Summary of the invention

[0004] In order to address the deficiencies mentioned in the above background technology, the purpose of the present invention is to provide a method and system for predicting the number of people participating in outdoor fitness activities by grade. By collecting and analyzing the usage of outdoor fitness facilities in typical areas and the characteristics of their surrounding environment, a prediction model is constructed to accurately predict the graded number of facility users of different age groups in different time periods.

[0005] In a first aspect, the purpose of the present invention can be achieved by the following technical solution: a method for predicting the number of people participating in outdoor fitness activities by grading, the method comprising the following steps:

[0006] Receiving fitness facility related data, performing data preprocessing based on the fitness facility related data combined with unique hot encoding, and obtaining a city fitness facility database, wherein the fitness facility related data includes: fitness facility usage data, fitness facility own characteristic data, and environmental condition data;

[0007] The urban fitness facility database is divided into a training set and a test set, the training set is input into a pre-established preliminary population classification prediction model for training optimization, and the test set is input into the trained population classification prediction model for testing, so as to obtain a trained and tested population classification prediction model, wherein the preliminary population classification prediction model is trained based on a random forest classification algorithm;

[0008] Obtain the variables of the area to be predicted, input the variables of the area to be predicted into the population grading prediction model after training and testing, and output the prediction results of the activity number interval and the corresponding activity number level, wherein the variables of the area to be predicted include time period, population category and surrounding environment characteristics.

[0009] In combination with the first aspect, in some implementations of the first aspect, the method further includes: a process of acquiring the fitness facility related data is as follows:

[0010] Through the survey, the number of people of three different ages participating in activities on weekdays and non-working days, and in the morning, noon and evening time periods are recorded. The three different ages include: children, young and middle-aged people, and the elderly; the facilities are classified according to whether there are equipment in the facilities, including site type and equipment type, and the facility usage data is obtained; the facility-related characteristic data are collected, including hard paved area, number of internal facilities and open boundary length; and environmental conditions data in the surrounding area, including public space area and traffic conditions.

[0011] In combination with the first aspect, in some implementations of the first aspect, the method further includes: the process of collecting the facility-related characteristic data:

[0012] Use drone remote sensing to obtain facility spatial layout and size information, and use image processing software to extract the hard paved area and boundary open length characteristics of the facility. Use on-site field surveys to record the number, distribution and use of equipment inside the facility. Combine photo records with post-analysis software and label classification to generate a detailed database of the facility itself as the facility's own characteristic data;

[0013] The process of collecting environmental condition data within the surrounding area:

[0014] Map software is used to obtain public space, road network, traffic conditions and other relevant data within the vicinity of the facility. After generating a spatial buffer using GIS analysis tools, various spatial feature data within the spatial buffer are overlaid with multi-source layers for analysis, and green space polygons, public facility locations, building layouts and road segments overlapping with the buffer are extracted. Spatial statistical tools are further used to calculate indicators such as green coverage rate, public space area, road density, traffic flow, and building density within the buffer zone, and various spatial data are converted into quantitative environmental feature indicators, which are finally integrated to generate environmental condition data within the surrounding area.

[0015] In combination with the first aspect, in some implementations of the first aspect, the method further includes: the data preprocessing process:

[0016] Data cleaning and standardization: Clean the multi-source data obtained through survey records, drone remote sensing images, map APIs, and on-site field surveys, and handle missing values ​​and outliers.

[0017] Encode and standardize spatial data into categorical variables to convert geographic information into a numerical feature format that can be used by the model.

[0018] In combination with the first aspect, in some implementations of the first aspect, the method further includes: the process of performing data preprocessing based on the fitness facility related data combined with one-hot encoding:

[0019] Based on the classification rules of the number of people, the number of people is converted into classification labels, and the original number column is deleted, and the classification information is retained as the target variable. The classification variables include time periods: morning, noon, and evening; population categories: children, young and middle-aged people, the elderly, and facility types: venue type and equipment type. The variables are converted into numerical forms acceptable to the model through one-hot encoding. The numerical variables include the characteristic data of the fitness facilities themselves and the characteristics of the surrounding environment. The categorical variables and the numerical variables are complementary and independent of each other, and both need to be standardized. After completing the data preprocessing, the data set is divided into a training set and a test set according to the preset ratio.

[0020] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: the classification of the pre-established preliminary number of people classification prediction model is performed according to the different characteristics of working days and non-working days, and the difference in the use of venue-type facilities and equipment-type facilities. The pre-established preliminary number of people classification prediction model is expressed as follows:

[0021]

[0022] in is the predicted classification label, c is the candidate classification category, x is the input feature vector, including time period, crowd category, facility characteristics and surrounding environment characteristics, T is the total number of decision trees in the random forest, P t (c|x) is the predicted probability that the input feature x belongs to category c by the t-th decision tree, and argmax is the classification category that maximizes the value in the brackets.

[0023] In combination with the first aspect, in some implementations of the first aspect, the method further includes: the training process of the preliminary population classification prediction model includes hyperparameter tuning and feature selection; the hyperparameter tuning is as follows:

[0024] Use the random forest classification algorithm and set the default parameters to initially train the model:

[0025] The GridSearchCV grid search technology is used to tune hyperparameters. The optimized parameters include: the number of decision trees, the maximum depth of the tree, the minimum number of samples required for internal node re-division, the minimum number of samples for leaf nodes, and whether to enable the self-service sampling method. During the parameter tuning process, the macro F1 score is used as the main performance evaluation indicator, and the optimal parameter combination is selected to improve the prediction performance of the preliminary population classification prediction model;

[0026] The feature selection refers to calculating the importance of each feature in the random forest model, including: time period, facility area and surrounding environmental conditions, sorting by importance score, constructing different feature subsets, retraining the random forest model respectively, recording the macro F1 scores of different subset models, drawing the feature number and performance curve, and selecting the optimal feature combination.

[0027] In combination with the first aspect, in some implementations of the first aspect, the method further includes: when the test set is input into the trained population classification prediction model for testing, by evaluating the accuracy, recall rate and macro F1 score of the trained population classification prediction model, determining whether the trained population classification prediction model meets the standard, wherein:

[0028] The accuracy is calculated as follows:

[0029]

[0030] The recall is calculated as follows:

[0031]

[0032] TP is the number of samples correctly predicted as positive, TN is the number of samples correctly predicted as negative, FP is the number of samples incorrectly predicted as positive, and FN is the number of samples incorrectly predicted as negative;

[0033] The macro F1 score is calculated as follows:

[0034]

[0035] in:

[0036]

[0037] The n is the number of classification categories, Recal l i is the recall rate of category i, Precision i is the precision of category i.

[0038] In combination with the first aspect, in some implementations of the first aspect, the method further includes: the calculation process of inputting the to-be-predicted area variable into the trained and tested population grading prediction model, and outputting the prediction result of the activity population interval and the corresponding activity population grade is as follows:

[0039] The variables of the area to be predicted are input into the trained population classification prediction model. The model calculates according to the input features and outputs the activity population intervals, which correspond to low usage level, medium usage level, and high usage level respectively:

[0040] Predicted number of people interval = f(x)

[0041] Among them, x is the input variable vector of the area to be predicted, and f is the trained and optimized population classification prediction model.

[0042] In a second aspect, in order to achieve the above-mentioned purpose, the present invention discloses a system for predicting the number of people participating in outdoor fitness activities by grading, comprising:

[0043] A data processing module is used to receive fitness facility related data, perform data preprocessing based on the fitness facility related data combined with unique hot coding, and obtain a city fitness facility database, wherein the fitness facility related data includes: fitness facility usage data, fitness facility own characteristic data, and environmental condition data;

[0044] A model training module is used to divide the urban fitness facility database into a training set and a test set, input the training set into a pre-established preliminary population classification prediction model for training optimization, and input the test set into the trained population classification prediction model for testing, so as to obtain a trained and tested population classification prediction model, wherein the preliminary population classification prediction model is trained based on a random forest classification algorithm;

[0045] The hierarchical prediction module is used to obtain the variables of the area to be predicted, input the variables of the area to be predicted into the hierarchical prediction model of the number of people after training and testing, and output the prediction results of the active number interval and the corresponding active number level, wherein the variables of the area to be predicted include time period, crowd category and surrounding environment characteristics.

[0046] Beneficial effects of the present invention:

[0047] Based on the random forest classification algorithm, the present invention combines multi-source data to accurately predict the number of people participating in outdoor fitness facilities, so as to reflect the degree of activity and significantly improve the dynamic analysis capability of the use level of outdoor fitness facilities. By inputting factors such as time period, crowd category, facility conditions and surrounding environment characteristics, the prediction results can be refined to the specific user classification, which enhances the accurate grasp of facility demand and usage.

[0048] The present invention starts from the comprehensive perspective of the facility's own conditions and the surrounding environment characteristics, and establishes a standardized data processing and model optimization process. Through hyperparameter tuning and feature selection technology, the model prediction performance is significantly improved, providing a reliable technical guarantee for the supply and demand analysis of urban fitness facilities. At the same time, the model quantitatively analyzes the relationship between facility characteristics and the number of users, which can be used to identify areas with insufficient demand or potential high demand, and provide data support for optimizing resource allocation.

[0049] The present invention has the characteristics of dynamic updating and iterative optimization, and can timely adjust the prediction model according to the distribution of fitness facilities and changes in urban development, so as to achieve long-term support for facility planning. With the help of visual analysis methods, it can display the usage of different time periods, groups and types of facilities, providing a comprehensive and accurate decision-making basis for the scientific planning and reasonable layout of urban fitness facilities, helping to better meet the fitness needs of residents and improve the service efficiency of facilities, and providing scientific technical support and practical paths for the sustainable development of cities and the healthy life of residents. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0051] Figure 1 It is a schematic flow chart of the method of the present invention;

[0052] Figure 2 It is a schematic diagram of the system structure of the present invention;

[0053] Figure 3 This is an operation interface diagram of the present invention for processing fitness facility point data based on the GIS platform;

[0054] Figure 4 Schematic diagram of receiver operating characteristic (ROC) curves and corresponding area under the curve (AUC) indicators of the classification model of the present invention in different categories;

[0055] Figure 5 It is a schematic diagram of the TOP10 important features identified by the random forest in the model of the present invention and their importance scores. DETAILED DESCRIPTION

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

[0057] Embodiment 1:

[0058] like Figure 1 As shown, a method for grading and predicting the number of people participating in outdoor fitness activities comprises the following steps:

[0059] Receiving fitness facility related data, performing data preprocessing based on the fitness facility related data combined with unique hot encoding, and obtaining a city fitness facility database, wherein the fitness facility related data includes: fitness facility usage data, fitness facility own characteristic data, and environmental condition data;

[0060] The process of acquiring the fitness facility related data is as follows:

[0061] Through the survey, the number of people of three different ages participating in the activities in three time periods, namely, children, young adults, and the elderly, was recorded on working days and non-working days, and in the morning, noon, and evening. The facilities were classified according to whether the equipment was distributed in the facilities, including the type of venue and the type of equipment, and the data on the use of the facilities was obtained. The data on the inherent characteristics of the facilities were collected, including the hard paved area, the number of internal facilities, and the length of the open boundaries, etc. (such as the hard paved area, the number of internal facilities, the length of the open boundaries, etc.). The data on the inherent characteristics of the facilities (such as the hard paved area, the number of facilities, the length of the open boundaries, etc.) and the environmental conditions within a radius of 300 meters were collected, including the area of ​​public space and traffic conditions.

[0062] Specifically, the survey records the number of people of three different ages participating in activities on weekdays and non-working days and in different time periods, and divides fitness facilities into site-type and equipment-type according to the distribution of equipment in the facilities, to obtain data on the number of people participating in activities in the facilities.

[0063] Among them, the different time periods refer to morning (6:30-10:30), afternoon (12:30-16:30), and evening (18:00-22:00). The selected time periods are evenly spaced and cover the main activity time periods of residents. They are representative and can also reflect differences.

[0064] The different populations mentioned herein refer to children (0-<15 years old), young adults (15-<60 years old) and the elderly (≥60 years old).

[0065] The process of collecting the characteristic data related to the facility is as follows:

[0066] Calculation and entry of the facility’s own conditions, surrounding facilities and environmental conditions.

[0067] Collect data related to the facility's own characteristics (such as hard paved area, number of internal facilities, border open length, etc.). Use drone remote sensing to obtain facility spatial layout and size information, and use image processing software (such as ArcGIS or QGIS) to extract features such as the hard paved area and border open length of the facility. Use on-site field surveys to record the number, distribution and use of equipment inside the facility, and generate a detailed database of the facility itself through photo records combined with post-analysis software annotation and classification.

[0068] Furthermore, the characteristic data related to the facilities (such as hard paved area, number of facilities, length of open boundaries, etc.) and the environmental condition data within the surrounding area (such as public space area, traffic conditions, etc.) are collected to build a database of urban fitness facilities in the form of multi-source data. The public space, road network and traffic condition data within 300 meters around the facilities are obtained by using the AutoNavi open platform or Baidu Map API, and the spatial buffer is generated through the geographic information system (GIS) analysis tool to calculate the environmental indicators within the target range, such as green coverage and public space area.

[0069] The data preprocessing process:

[0070] Data cleaning and standardization: Use Python or R language to clean multi-source data obtained from different sources, process missing values ​​and outliers, and ensure data integrity and consistency;

[0071] Categorical variable encoding and standardization of spatial data are performed to convert geographic information into a numerical feature format that can be used by the model, providing standardized input data for subsequent model construction.

[0072] The process of data preprocessing based on fitness facility related data combined with unique hot encoding:

[0073] The pandas library is used to load the dataset from the CSV file, including the original number of people data obtained from the survey and the corresponding facility feature data. Based on the classification rules of the number of people (such as 0-5, 6-10, and greater than 10), the number of people is converted into classification labels, and the original number of people column is deleted, retaining the classification information as the target variable. The specific classification variables include time period (morning, noon, and evening), population category (children, young and middle-aged, and elderly), and facility type (venue type, equipment type). These variables are converted into numerical forms acceptable to the model through unique hot encoding. Numerical variables include the characteristic data of fitness facilities themselves (such as hard paved area, boundary open length, number of equipment, etc.) and surrounding environmental characteristics (such as green coverage, public space area, road density, etc.). Categorical variables and numerical variables are complementary, independent of each other, and both need to be standardized to reduce the impact of numerical deviation on model performance. Use train_test_split to divide the dataset into training set and test set at a preset ratio of 7:3 to ensure that the training data fully covers different facility types and population distribution scenarios, providing a comprehensive learning sample for the model.

[0074] The urban fitness facility database is divided into a training set and a test set, the training set is input into a pre-established preliminary population classification prediction model for training optimization, and the test set is input into the trained population classification prediction model for testing, so as to obtain a trained and tested population classification prediction model, wherein the preliminary population classification prediction model is trained based on a random forest classification algorithm;

[0075] The classification of the pre-established preliminary number of people classification prediction model is carried out according to the different characteristics of working days and non-working days, and the difference in the use of venue-type facilities and equipment-type facilities. The pre-established preliminary number of people classification prediction model is as follows:

[0076]

[0077] in is the predicted classification label, i.e., the population classification, c is the candidate classification category, x is the input feature vector, including time period, population category, facility characteristics (such as area, boundary I open length, number of equipment) and surrounding environment characteristics (such as green coverage, road density, public space area), T is the total number of decision trees in the random forest, P t (c|x) is the predicted probability that the input feature x belongs to category c by the t-th decision tree, and argmax is the classification category that maximizes the value in the brackets.

[0078] As shown in Table 1, for the problem of predicting the number of people participating in outdoor fitness activities, this application finally selected a classification model based on random forests. This model can provide higher accuracy and stability by processing complex nonlinear relationships and abnormal data. Compared with other common classification models such as support vector machines (SVM) and gradient boosting decision trees (GBDT), random forests perform better in classification accuracy and F1 scores. It can automatically evaluate the importance of features, reflect the impact of facility characteristics, time periods and crowd categories on the number of people participating in fitness activities, and thus better guide the planning and resource allocation of fitness facilities. Experimental comparisons show that compared with other models, the classification model based on random forests shows higher accuracy and stability when processing outdoor fitness activity data, which makes it a more reliable choice for predicting and optimizing the use of fitness facilities.

[0079] Table 1 Comparison of classification models and analysis of their advantages and disadvantages

[0080]

[0081] The training process of the preliminary population classification prediction model includes hyperparameter tuning and feature selection; the hyperparameter tuning is as follows:

[0082] Use the random forest classification algorithm and set the default parameters to initially train the model:

[0083] Use GridSearchCV grid search technology to tune hyperparameters. The optimization parameters include: n_estimators: number of decision trees, max_depth: maximum depth of the tree, min_samples_split: minimum number of samples required for internal node re-division, min_samples_leaf: minimum number of samples for leaf nodes, bootstrap: whether to enable the self-service sampling method. During the parameter tuning process, use the macro F1 score as the main performance evaluation indicator, and select the optimal parameter combination to improve the prediction performance of the preliminary population classification prediction model;

[0084] The feature selection refers to calculating the importance of each feature in the random forest model, including: time period, facility area and surrounding environmental conditions, sorting by importance score, constructing different feature subsets (such as the top 10, 15, and 20 high-importance features), retraining the random forest model separately, recording the macro F1 scores of different subset models, plotting the number of features and performance curves, and selecting the optimal feature combination.

[0085]

[0086] Among them, T r→\1 is the Gini impurity of the classes of all child nodes of node ", is the node. After the feature v is divided, the Gini impurity of each type of node, Tr→\1 is the Gini impurity of node r.

[0087] When the test set is input into the trained population classification prediction model for testing, the accuracy, recall rate and macro F1 score of the trained population classification prediction model are evaluated to determine whether the trained population classification prediction model meets the standards, wherein:

[0088] The accuracy is calculated as follows:

[0089]

[0090] The recall is calculated as follows:

[0091]

[0092] The TP (True Positive) is the number of samples correctly predicted as positive, TN (True Negative) is the number of samples correctly predicted as negative, FP (False Positive) is the number of samples incorrectly predicted as positive, and FN (False Negative) is the number of samples incorrectly predicted as negative.

[0093] The macro F1 score is calculated as follows:

[0094]

[0095] in:

[0096]

[0097] The n is the number of classification categories, Recal l i is the recall rate of category i, Precision i is the accuracy of category i. Obtain the variables of the area to be predicted, input the variables of the area to be predicted into the population classification prediction model after training and testing, and output the prediction results of the activity population interval and the corresponding activity population level, wherein the variables of the area to be predicted include time period, population category and surrounding environment characteristics.

[0098] The process of inputting the variable of the area to be predicted into the training and testing population classification prediction model, and outputting the prediction result of the activity population interval and the calculation process of the corresponding activity population level is as follows:

[0099] The preprocessed variables are input into the trained crowd classification prediction model. The model calculates based on the input features and outputs the activity crowd intervals such as 0-5 people, 6-10 people, and more than 10 people, which correspond to low usage level, medium usage level, and high usage level, respectively.

[0100] Predicted number of people interval = f(x)

[0101] Among them, x is the input variable vector of the area to be predicted, and f is the trained and optimized population classification prediction model.

[0102] Specifically, the present invention is further described below by way of embodiments:

[0103] Input feature factors and regional feature extraction.

[0104] The characteristic factor classification includes:

[0105] Time characteristics: including three time periods: morning, noon and evening, as well as the classification of working days and non-working days.

[0106] Population characteristics: Based on the age structure of the population in the target area, the relative proportions of the three groups are divided into children, young adults and the elderly.

[0107] Facility Characteristics: Enter the specific parameters of the fitness facilities in the area, such as the hard paved area, number of equipment, and boundary open length.

[0108] Surrounding environment characteristics: extract the public space conditions (such as area, distance, etc.), traffic conditions (such as distances of different graded roads, intersections, etc.) and distribution of nearby living facilities (such as shops, schools, etc.) within the 300-meter buffer zone of the facility.

[0109] The input feature factors of the target area are imported into the optimized and trained random forest classification model, and the model is run to calculate and obtain the graded prediction results of the number of people participating in fitness activities in the corresponding area.

[0110] For site-type and equipment-type facilities, corresponding classification models are used for prediction to ensure the adaptability of the model to different types of facilities.

[0111] Based on the prediction results, the distribution map of the number of people participating in fitness activities in the target area is generated by combining ArcGIS visualization technology, which intuitively presents the hierarchical distribution characteristics of the number of people in different types of facilities and regions. The matching degree between the level of facility use and the needs of the population is analyzed to identify areas with inefficient use of facilities or insufficient demand.

[0112] Based on the results, suggestions for optimizing facility configuration are put forward, dynamic forecasts for different time periods and population categories are provided, and relevant departments are assisted in planning targeted measures to improve facility configuration efficiency and residents’ fitness satisfaction.

[0113] Table 2 Activity types belong to facility types

[0114]

[0115] Table 3 Surrounding facilities and environmental conditions Class I traffic situation characteristic variables

[0116]

[0117] Table 4. Surrounding facilities and environmental conditions, category II public space characteristic variables

[0118]

[0119] Table 5 Characteristic variables of building communities of category III surrounding facilities and environmental conditions

[0120]

[0121]

[0122] Table 6 Characteristic variables of population situation in category IV of surrounding facilities and environmental conditions

[0123]

[0124] Table 7. Characteristics variables of information points of category V Poi in terms of surrounding facilities and environmental conditions

[0125]

[0126]

[0127] Table 8. Facility condition characteristic variables

[0128]

[0129] Table 9 The best parameter combination and performance evaluation results of the random forest classification model after grid search optimization

[0130]

[0131] As shown in Table 9, the best parameter settings include: bootstrap is False, class_weight is None, max_depth is 11, max_features is "sqrt", min_samples_leaf is 7, min_samples_split is 9, n_estimators is 824, and the corresponding best score is 0.8058. The classification report shows that the overall accuracy of the model reaches 0.87, and the macro-average index shows that the overall performance of the model on samples of each category is 0.77 precision, 0.71 recall, and 0.74 f1-score, while the weighted average index is 0.85, 0.87, and 0.85 in terms of precision, recall, and f1-score, respectively, which comprehensively reflects the prediction ability of the model under the condition of uneven sample size and the classification effect after optimization.

[0132] Specifically, Figure 3 As shown in the figure, this figure shows the operation interface for processing fitness facility point data based on the GIS platform. The spatial points of fitness facilities are obtained through the open platform, and Baidu Maps is loaded as the base map in GIS, and relevant spatial data is integrated. During the operation, GIS tools are used for spatial analysis to calculate the characteristic variables around the facilities, such as green coverage rate, traffic network density, etc. This interface reflects the intuitive operation process of data processing and analysis, and provides technical support for the study of the use characteristics of fitness facilities and the construction of model input data.

[0133] Table 10 Data processing process before model training

[0134]

[0135] As shown in Table 10, the data processing process before model training is shown, including core information such as time period, applicable population, number of people, and surrounding feature data. The time period is coded with numbers to represent different time periods within a day. The applicable population reflects the category of facility users, and will also be coded digitally in the future. The number of people is the data recorded in the actual survey, and the surrounding feature data covers the key indicators of the environmental conditions around the facility. By integrating and preprocessing these data, the data input to the model is ensured to be uniform and high-quality, providing a reliable data foundation for subsequent model training and prediction.

[0136] like Figure 4 As shown in the figure, this figure shows the receiver operating characteristic (ROC) curve and the corresponding area under the curve (AUC) indicator of the classification model in different categories, which is used to evaluate the classification performance of the model. Among them, the AUC value corresponding to the ROC curve of category 0 is 0.96, the AUC value of category 1 is 0.94, and the AUC value of category 2 is 0.97. The closer the curve is to the upper left corner, the closer the AUC value is to 1, indicating that the classification performance of the model is better. This figure shows that the model has good discrimination ability in all categories and has high prediction accuracy.

[0137] like Figure 5As shown in the figure, this figure shows the TOP10 important features identified by the random forest in the model and their importance scores, reflecting the contribution of each feature to the model prediction results. Among them, the ratio of equipment to active area (Importance: 1618.206066) has the greatest impact on the predicted number of users, indicating that a larger proportion of equipment may increase the utilization rate and density of the active area and significantly affect the number of users. The second is the openness rate (Importance: 1049.319314). Higher openness and accessibility may attract more users. Other important features include time period_noon (Importance:674.698140), user group_C (Importance:645.376031), nearest company (Importance:412.449093), activity area ratio (Importance:409.459265), nearest water system (Importance:386.198043), user group_A (Importance:378.173459) and hard surface area (Importance:375.658787), among which the proportion of hard surface may affect the comfort and applicability of activities, thereby affecting the number of users. This analysis reveals the relative importance of different factors in predicting the number of users, providing data support for further optimizing facility planning.

[0138] Embodiment 2: In the second aspect, as Figure 2 As shown, in order to achieve the above-mentioned purpose, the present invention discloses a hierarchical prediction system for the number of people participating in outdoor fitness activities, comprising:

[0139] The data processing module 11 is used to receive fitness facility related data, perform data preprocessing based on the fitness facility related data combined with unique hot coding, and obtain a city fitness facility database, wherein the fitness facility related data includes: fitness facility usage data, fitness facility own characteristic data, and environmental condition data;

[0140] The model training module 12 is used to divide the urban fitness facility database into a training set and a test set, input the training set into a pre-established preliminary population classification prediction model for training optimization, and input the test set into the trained population classification prediction model for testing, so as to obtain a trained and tested population classification prediction model, wherein the preliminary population classification prediction model is trained based on a random forest classification algorithm;

[0141] The hierarchical prediction module 13 is used to obtain the variables of the area to be predicted, input the variables of the area to be predicted into the hierarchical prediction model of the number of people after training and testing, and output the prediction results of the active number interval and the corresponding active number level, wherein the variables of the area to be predicted include time period, crowd category and surrounding environment characteristics.

[0142] Based on the same inventive concept, the present invention also provides a computer device, which includes: one or more processors, and a memory for storing one or more computer programs; the program includes program instructions, and the processor is used to execute the program instructions stored in the memory. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is used to implement one or more instructions, specifically for loading and executing one or more instructions in a computer storage medium to implement the above method.

[0143] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0144] The above shows and describes the basic principles, main features and advantages of the present disclosure. Those skilled in the art should understand that the present disclosure is not limited by the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present disclosure. Without departing from the spirit and scope of the present disclosure, the present disclosure may have various changes and improvements, and these changes and improvements fall within the scope of the present disclosure to be protected.

Claims

1. A method for predicting the number of people participating in outdoor fitness activities by grading, characterized in that: The method comprises the following steps: Receiving fitness facility related data, performing data preprocessing based on the fitness facility related data combined with unique hot encoding, and obtaining a city fitness facility database, wherein the fitness facility related data includes: fitness facility usage data, fitness facility own characteristic data, and environmental condition data; The urban fitness facility database is divided into a training set and a test set, the training set is input into a pre-established preliminary population classification prediction model for training optimization, and the test set is input into the trained population classification prediction model for testing, so as to obtain a trained and tested population classification prediction model, wherein the preliminary population classification prediction model is trained based on a random forest classification algorithm; Obtain the variables of the area to be predicted, input the variables of the area to be predicted into the population grading prediction model after training and testing, and output the prediction results of the activity number interval and the corresponding activity number level, wherein the variables of the area to be predicted include time period, population category and surrounding environment characteristics.

2. The method for predicting the number of people participating in outdoor fitness activities according to claim 1, characterized in that: The process of acquiring the fitness facility related data is as follows: Through the survey, the number of people of three different ages participating in activities on weekdays and non-working days, and in the morning, noon and evening time periods are recorded. The three different ages include: children, young and middle-aged people, and the elderly; the facilities are classified according to whether there are equipment in the facilities, including site type and equipment type, to obtain facility usage data; the facility-related intrinsic characteristic data are collected, including hard paved area, number of internal facilities and open boundary length; and environmental conditions data in the surrounding area, including public space area and traffic conditions.

3. The method for predicting the number of people participating in outdoor fitness activities according to claim 2, characterized in that: The process of collecting the characteristic data related to the facility is as follows: Use drone remote sensing to obtain facility spatial layout and size information, and use image processing software to extract the hard paved area and boundary open length characteristics of the facility. Use on-site field surveys to record the number, distribution and use of equipment inside the facility. Combine photo records with post-analysis software and label classification to generate a detailed database of the facility itself as the facility's own characteristic data; The process of collecting environmental condition data within the surrounding area: Map software is used to obtain public space, road network, traffic conditions and other relevant data within the vicinity of the facility. After generating a spatial buffer using GIS analysis tools, various spatial feature data within the spatial buffer are overlaid with multi-source layers for analysis, and green space polygons, public facility locations, building layouts and road segments overlapping with the buffer are extracted. Spatial statistical tools are further used to calculate indicators such as green coverage rate, public space area, road density, traffic flow, and building density within the buffer zone, and various spatial data are converted into quantitative environmental feature indicators, which are finally integrated to generate environmental condition data within the surrounding area.

4. The method for predicting the number of people participating in outdoor fitness activities according to claim 1, characterized in that: The data preprocessing process: Data cleaning and standardization: Clean and process multi-source data obtained from survey records, drone remote sensing images, map APIs, and on-site field surveys, and handle missing values ​​and outliers; Encode and standardize spatial data into categorical variables to convert geographic information into a numerical feature format that can be used by the model.

5. The method for predicting the number of people participating in outdoor fitness activities according to claim 1, characterized in that: The process of data preprocessing based on fitness facility related data combined with unique hot encoding: Based on the classification rules of the number of people, the number of people is converted into classification labels, and the original number column is deleted, and the classification information is retained as the target variable. The classification variables include time periods: morning, noon, and evening; population categories: children, young and middle-aged people, the elderly, and facility types: venue type and equipment type. The variables are converted into numerical forms acceptable to the model through one-hot encoding. The numerical variables include the characteristic data of the fitness facilities themselves and the characteristics of the surrounding environment. The categorical variables and the numerical variables are complementary and independent of each other, and both need to be standardized. After completing the data preprocessing, the data set is divided into a training set and a test set according to the preset ratio.

6. The method for predicting the number of people participating in outdoor fitness activities according to claim 1, characterized in that: The classification of the pre-established preliminary number of people classification prediction model is carried out according to the different characteristics of working days and non-working days, and the difference in the use of venue-type facilities and equipment-type facilities. The pre-established preliminary number of people classification prediction model is expressed as follows: in is the predicted classification label, c is the candidate classification category, x is the input feature vector, including time period, crowd category, facility characteristics and surrounding environment characteristics, T is the total number of decision trees in the random forest, P t (c|x) is the predicted probability that the input feature x belongs to category c by the t-th decision tree, and argmax is the classification category that maximizes the value in the brackets.

7. The method for predicting the number of people participating in outdoor fitness activities according to claim 1, characterized in that: The training process of the preliminary population classification prediction model includes hyperparameter tuning and feature selection; the hyperparameter tuning is as follows: Use the random forest classification algorithm and set the default parameters to initially train the model: The GridSearchCV grid search technology is used to tune hyperparameters. The optimized parameters include: the number of decision trees, the maximum depth of the tree, the minimum number of samples required for internal node re-division, the minimum number of samples for leaf nodes, and whether to enable the self-service sampling method. During the parameter tuning process, the macro F1 score is used as the main performance evaluation indicator, and the optimal parameter combination is selected to improve the prediction performance of the preliminary population classification prediction model; The feature selection refers to calculating the importance of each feature in the random forest model, including: time period, facility area and surrounding environmental conditions, sorting by importance score, constructing different feature subsets, retraining the random forest model respectively, recording the macro F1 scores of different subset models, plotting the number of features and performance curves, and selecting the optimal feature combination; Among them, T r→\1 is the Gini impurity of the classes of all child nodes of node ", is the node. After the feature v is divided, the Gini impurity of each type of node, T r→\1 is the Gini impurity of node r.

8. The method for predicting the number of people participating in outdoor fitness activities according to claim 7, characterized in that: When the test set is input into the trained population classification prediction model for testing, the accuracy, recall rate and macro F1 score of the trained population classification prediction model are evaluated to determine whether the trained population classification prediction model meets the standards, wherein: The accuracy is calculated as follows: The recall is calculated as follows: TP is the number of samples correctly predicted as positive, TN is the number of samples correctly predicted as negative, FP is the number of samples incorrectly predicted as positive, and FN is the number of samples incorrectly predicted as negative; The macro F1 score is calculated as follows: in: The n is the number of classification categories, Recall i is the recall rate of category i, Precision i is the precision of category i.

9. The method for predicting the number of people participating in outdoor fitness activities according to claim 1, characterized in that: The process of inputting the variable of the area to be predicted into the training and testing population classification prediction model, and outputting the prediction result of the activity population interval and the calculation process of the corresponding activity population level is as follows: The variables of the area to be predicted are input into the trained population classification prediction model. The model calculates according to the input features and outputs the activity population intervals, which correspond to low usage level, medium usage level, and high usage level respectively: Predicted number of people interval = f(x) Among them, x is the input variable vector of the area to be predicted, and f is the trained and optimized population classification prediction model.

10. A system for predicting the number of people participating in outdoor fitness activities by grading, using a method for predicting the number of people participating in outdoor fitness activities by grading according to any one of claims 1 to 9, characterized in that: include: A data processing module is used to receive fitness facility related data, perform data preprocessing based on the fitness facility related data combined with unique hot coding, and obtain a city fitness facility database, wherein the fitness facility related data includes: fitness facility usage data, fitness facility own characteristic data, and environmental condition data; A model training module is used to divide the urban fitness facility database into a training set and a test set, input the training set into a pre-established preliminary population classification prediction model for training optimization, and input the test set into the trained population classification prediction model for testing, so as to obtain a trained and tested population classification prediction model, wherein the preliminary population classification prediction model is trained based on a random forest classification algorithm; The hierarchical prediction module is used to obtain the variables of the area to be predicted, input the variables of the area to be predicted into the hierarchical prediction model of the number of people after training and testing, and output the prediction results of the active number interval and the corresponding active number level, wherein the variables of the area to be predicted include time period, crowd category and surrounding environment characteristics.

Citation Information

Patent Citations

  • Method for allocating the capacity of facilities in a ski area, an amusement park, or a stadium

    CN108255942A

  • Artificial intelligence model for national fitness

    CN114496160A

  • Urban park use activeness prediction method, storage medium and terminal

    CN114611838A

  • Bodybuilding people number statistical method, electronic equipment and computer readable storage medium

    CN116485439A

  • Method and device for predicting number of people in gymnasium

    CN117992843A