A shared bicycle dangerous riding behavior detection method based on image recognition
By acquiring shared bicycle riding trajectory data with precise timestamps and matching it with high-precision maps, a neural network was built and trained, solving the problem of low efficiency in traditional regulatory methods and achieving efficient detection and management of dangerous riding behavior on shared bicycles.
Patent Information
- Application Number
- CN202510207669.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2045-02-25
AI Technical Summary
Traditional methods of regulating cycling safety are inefficient and have limited coverage, making it difficult to effectively curb dangerous cycling behavior on shared bicycles.
By acquiring shared bicycle riding trajectory data with precise timestamps, matching it to a high-precision map, preprocessing and extracting feature parameters, constructing and training a neural network, and realizing the detection of dangerous riding behaviors.
It improves cycling safety and management efficiency, significantly enhances the accuracy and comprehensiveness of detection methods, and enables efficient management of shared bicycle riding.
Smart Images

Figure CN119693892B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of intelligent transportation and artificial intelligence, and specifically relates to a shared bicycle dangerous riding behavior detection method based on image recognition. BACKGROUND
[0002] The traditional riding safety supervision method mainly relies on manual patrol and on-site law enforcement, which has problems such as low efficiency, limited coverage, high cost, etc., and is difficult to effectively curb the occurrence of shared bicycle dangerous riding behavior. The shared bicycle dangerous riding behavior detection method based on intelligent transportation and artificial intelligence can obtain shared bicycle riding trajectory data, match the motion trajectory with the map base map, judge whether the rider has dangerous riding behavior, and output the detection result. This method has the advantages of high efficiency, accuracy, wide coverage, etc., and can significantly improve the efficiency and effectiveness of riding safety supervision, and provide strong support for urban traffic management. Therefore, it is of great significance to develop an efficient and intelligent shared bicycle dangerous riding behavior detection method for improving riding safety and maintaining traffic order. SUMMARY
[0003] To solve the above problems, the present application discloses a shared bicycle dangerous riding behavior detection method based on image recognition, which aims to accurately detect dangerous behavior in shared bicycle riding and improve riding safety and management efficiency.
[0004] To achieve the above purpose, the technical scheme of the present application is as follows:
[0005] A shared bicycle dangerous riding behavior detection method based on image recognition, comprising the following steps:
[0006] S1. Obtain shared bicycle riding trajectory data with time stamp;
[0007] S2. Match the trajectory data to the high-precision map;
[0008] S3. Preprocess the matched trajectory riding image and extract trajectory feature parameters;
[0009] S4. Mark the extracted trajectory feature parameters as normal riding and dangerous riding trajectory;
[0010] S5. Make training set and validation set according to the proportion of feature parameters;
[0011] S6. Construct a shared bicycle dangerous riding behavior detection neural network and initialize its network parameters to obtain a primary shared bicycle dangerous riding behavior detection neural network;
[0012] S7. Train the primary shared bicycle dangerous riding behavior detection neural network through the training set;
[0013] S8. Put the verification set into the trained shared bicycle dangerous riding behavior detection neural network for verification, and evaluate the network;
[0014] S9. Collect shared bicycle trajectory data to be identified and match with a high-precision map to form an image to be identified, pre-process the image to be identified, and input the pre-processed image to be identified into the completed shared bicycle dangerous riding behavior detection neural network to obtain a shared bicycle dangerous riding behavior identification result.
[0015] Preferably, in the S1, the shared bicycle riding trajectory data with timestamps is accurate to the second level, and each timestamp is t1, t2, t3...tn with the same interval time, which can accurately reflect the time sequence of riding.
[0016] Preferably, in the S2, the trajectory data is matched to the high-precision map by using a matching algorithm and Qgis software.
[0017] Preferably, in the S3, the pre-processing of the matched trajectory riding image refers to size normalization processing of the image to ensure the consistency of the image size in subsequent analysis and processing, and the feature parameter is the trajectory riding direction.
[0018] Preferably, in the S4, the dangerous riding trajectory includes reverse, illegal left turn, and crossing the road.
[0019] Preferably, in the S5, the ratio of the training set to the test set is 7:3.
[0020] Preferably, in the S6, the network parameter initialization operation initializes the weight parameters and bias parameters in the neural network by using a random initialization method.
[0021] Preferably, in the S7, the specific training process includes the following steps:
[0022] S21: Normalize all data in the training set;
[0023] S22: Put the processed data into the neural network and sequentially pass through the convolution layer, the pooling layer and the full connection layer for processing;
[0024] S23: Calculate the loss function of the trained neural network, and adjust the neural network according to the principle of minimum loss function.
[0025] Preferably, in the S8, the evaluation indicators for evaluating the network include accuracy and recall rate, the formula of the accuracy is: , and the formula of the recall rate is: .
[0026] The beneficial effects of the present application are:
[0027] (1) The present application adopts the means of obtaining shared bicycle riding track data with accurate time stamp to seconds level and same interval time, matching it to high-precision map, pre-processing the matched track riding image, extracting track feature parameters, marking normal and dangerous riding track, making training set and verification set, constructing and training neural network, which achieves the effect of accurately detecting dangerous behavior in shared bicycle riding, improving riding safety and management efficiency.
[0028] (2) The image size normalization processing is also adopted to ensure the consistency of image size, the dangerous riding track is defined as reverse, illegal left turn and crossing the road, the training set and test set ratio is set as 7:3, the random initialization method is adopted to initialize the neural network parameters, and the detailed training process and the accuracy and recall rate as evaluation index means are adopted to further optimize the detection method and guarantee the accuracy and stability of the detection.
[0029] (3) Compared with the prior art, the present application integrates various technical means to form a complete shared bicycle dangerous riding behavior detection system based on image recognition, improves the accuracy and comprehensiveness of shared bicycle dangerous riding behavior detection, and can more efficiently manage shared bicycle riding, greatly improving the riding safety. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 is the flowchart of the present application.
[0031] Figure 2 is the structure block diagram of the present application.
[0032] Figure 3 is the dangerous riding track diagram according to the present application.
[0033] Figure 4 is the normal riding track diagram according to the present application. DETAILED DESCRIPTION
[0034] The present application will be further illustrated below in combination with the drawings and specific embodiments, and it should be understood that the following specific embodiments are only used to illustrate the present application and not to limit the scope of the present application.
[0035] The core idea of the application is to analyze the abnormal riding state characteristics of the three dangerous riding behaviors of shared bicycle users, that is, reverse riding, crossing the road and illegal left turn, study the occurrence rules of dangerous riding state, mark normal and dangerous riding behaviors based on shared bicycle trajectory points and high-precision map matching images, input the training set into the model for training, test the trained model with the test set, extract in-transit dangerous riding behavior events in different traffic scenes, identify the evolution rules of riding risk state characteristics, and study the dangerous riding behavior identification architecture in multiple traffic scenes.
[0036] As shown in Figure 1 The shared bicycle dangerous riding behavior detection method based on image recognition provided by the application comprises the following steps:
[0037] S1. With the help of the positioning system or other related data acquisition devices of the shared bicycle, accurate to the second, time-stamped riding trajectory data is obtained, and the time stamp sequence is t1; t2; t3... tn. The time stamps are the same interval, which can accurately reflect the sequence and duration of riding, and build an accurate time information basis for subsequent analysis.
[0038] S2. Select a high-precision map that can present detailed geographical information including roads, intersections and landmarks, and use a matching algorithm to accurately correspond each coordinate point and its corresponding time stamp in the obtained shared bicycle riding trajectory data to the corresponding position on the high-precision map, ensuring accurate landing of the trajectory data on the map and strengthening the correlation and accuracy between the trajectory and the map.
[0039] S3. The matched trajectory riding image is preprocessed, such as size normalization, to ensure uniform image size for subsequent processing. On this basis, key trajectory feature parameters such as riding direction are extracted, which will be an important basis for judging whether the riding behavior is dangerous.
[0040] S4. The extracted trajectory feature parameters are classified and labeled as normal and dangerous riding trajectories. The feature parameters of normal riding conform to the conventional riding mode, while the dangerous riding trajectory feature parameters include sudden changes in riding direction, trajectory direction not conforming to traffic rules, including reverse riding, illegal left turn and crossing the road. This labeling provides a classification basis for subsequent data set construction and neural network training.
[0041] S5. The feature parameters are divided into training set and validation set according to the ratio of 7:3. The training set is used to train the neural network to master the feature rules, and the validation set is used to evaluate the performance of the trained network.
[0042] S6. Create a neural network dedicated to detecting dangerous cycling behavior of shared bicycles, and initialize the network parameters. Random initialization method is used to initialize the weight parameters and bias parameters in the neural network, forming a preliminary shared bicycle dangerous cycling behavior detection neural network with basic structure and initial parameter settings.
[0043] S7. Train the preliminary shared bicycle dangerous cycling behavior detection neural network with the training set: specifically including the following steps:
[0044] S71: Normalize all data in the training set: normalize the data in the training set, and unify the feature parameters in different value ranges to the standard interval to prevent the training effect of the neural network from being affected by the large difference in data value range.
[0045] S72: Put the processed data into the neural network and process it through the convolution layer, pooling layer and full connection layer in turn: input the normalized data into the neural network, and the data is processed through the convolution layer to extract local features, the pooling layer to reduce the data dimension and retain key features, and the full connection layer to comprehensively process the features extracted by the previous layers.
[0046] S73: Calculate the loss function of the trained neural network, and adjust the neural network according to the principle of minimizing the loss function: calculate the loss function according to the output results of the neural network and the actual labeled results (normal or dangerous cycling trajectory), and adjust the neural network convolution kernel weight and full connection layer connection weight parameter according to the principle of minimizing the loss function, using back propagation algorithm and other methods to continuously optimize the neural network in the training process.
[0047] S8. Input the verification set into the trained shared bicycle dangerous cycling behavior detection neural network for verification, and the network outputs the prediction according to the verification set data, and then evaluates the network through accuracy, recall rate and other evaluation indicators. The accuracy calculation formula is: (TP + TN) / (TP + TN + FP + FN) (TP is true positive, TN is true negative, FP is false positive, and FN is false negative); the recall rate calculation formula is: TP / (TP + FN). According to the evaluation results, further optimize the network performance to ensure that the network can accurately detect dangerous cycling behavior.
[0048] S9. Collect shared bicycle trajectory data to be identified, match with high-precision map to generate images to be identified, pre-process the images to be identified, and then input the pre-processed images into the trained and verified shared bicycle dangerous cycling behavior detection neural network. The network analyzes and judges according to the input image features, and outputs the identification result of whether there is dangerous cycling behavior in the image to be identified, thereby realizing the identification of dangerous cycling behavior of shared bicycles.
[0049] Figure 2 The structure block diagram of a shared bicycle dangerous riding behavior detection method based on image recognition of the present application. The figure shows a shared bicycle abnormal riding behavior detection method architecture, which is composed of multiple units, and the following is a detailed explanation of each unit:
[0050] Trajectory data acquisition unit: corresponding to step S1. Through the positioning system of the shared bicycle itself or other data acquisition devices, the riding trajectory data with accurate time stamps t1, t2, t3...tn is obtained. These time stamps are the same interval, which can accurately reflect the riding order and duration.
[0051] Map matching unit: corresponding to step S2. Select a high-precision map and use a matching algorithm to accurately match the coordinate points and their time stamps in the obtained riding trajectory data with the corresponding positions on the map.
[0052] Image preprocessing and feature extraction unit: corresponding to step S3. Perform size normalization and other preprocessing operations on the matched trajectory riding images to ensure uniform image size. Extract key trajectory feature parameters such as riding direction as important basis for judging whether the riding behavior is dangerous.
[0053] Feature labeling unit: corresponding to step S4. Classify the extracted trajectory feature parameters into normal and dangerous riding trajectories. Normal riding features conform to the conventional mode, and dangerous riding features include three behaviors: reverse, illegal left turn, and crossing the road, providing a classification basis for subsequent data set preparation and neural network training.
[0054] Data set preparation unit: corresponding to step S5. Divide the feature parameters into training set and validation set according to the ratio of 7:3.
[0055] Neural network construction and initialization unit: corresponding to step S6. Create a neural network specifically for detecting shared bicycle dangerous riding behavior, and use random initialization and other methods to initialize the weight and bias parameters to obtain a preliminary detection neural network.
[0056] Model training unit: corresponding to step S7. Including three sub-steps:
[0057] S71: Normalize the data in the training set to unify the feature parameters with different value ranges to the standard interval, preventing the difference in data value range from affecting the training effect.
[0058] S72: Input the normalized data into the neural network, and sequentially pass through the convolution layer to extract local features, the pooling layer to reduce the data dimension and preserve key features, and the fully connected layer to comprehensively process the features extracted by the previous layers.
[0059] S73: According to the neural network output result and the actual marked result, a loss function is calculated, and according to the loss function minimization principle, a back propagation algorithm is used to adjust the neural network parameters, so that the network is continuously optimized.
[0060] Model verification and evaluation unit: corresponding to S8 step. The verification set is input into the trained neural network for verification, the network predicts and outputs according to the verification set data, and then the network is evaluated by the two evaluation indexes of accuracy ((TP + TN) / (TP + TN + FP + FN)) and recall (TP / (TP + FN)), and the network performance is optimized according to the evaluation result.
[0061] Behavior recognition unit: corresponding to S9 step. The shared bicycle trajectory data to be recognized is collected, matched with the high-precision map to form the image to be recognized, preprocessed and input into the trained and verified neural network, the network analyzes and judges according to the image features, outputs the recognition result of whether there is dangerous riding behavior, and realizes the recognition of the dangerous riding behavior of the shared bicycle.
[0062] Figure 3 、 Figure 4 The dangerous and normal riding trajectory schematic diagram of the shared bicycle dangerous riding behavior detection method based on image recognition is shown.
[0063] In the figure, the normal riding trajectory and the abnormal riding trajectory of the shared bicycle in the road environment are clearly presented, and the purpose is to accurately distinguish and mark the two different types of riding trajectories, so as to be input into the convolutional neural network model for deep analysis and processing. For the input image data, the convolutional neural network can efficiently extract the key "feature" information from the image by virtue of its own convolution and pooling layer structure characteristics, and then further process the "compressed image information" through the subsequent full connection layer, and finally output the corresponding result.
[0064] The bottom map of the figure should be a high-precision satellite map, which shows the city environment elements such as roads, green belts and buildings in detail. At the same time, the map has obvious road signs and various traffic facilities, which can directly present the riding trajectory of the shared bicycle and provide a clear visual reference for accurately judging the riding behavior. It should be noted that, Figure 3 、 Figure 4 It is only a dangerous and normal riding trajectory schematic diagram, and the main purpose is to show the difference between the dangerous riding trajectory and the normal riding trajectory of the shared bicycle.
[0065] The following will be described in detail: Figure 3 、 Figure 4
[0066] Two positions in the figure are marked as the starting point and the ending point of the shared bicycle focus key trajectory, and the bicycle icon direction is the shared bicycle riding direction. Figure 3 The three dangerous riding trajectories include reverse, crossing the road, and illegal left turn, Figure 4 The corresponding normal trajectory is compared.
[0067] From the two diagrams, the criteria for judging whether the shared bicycle is a dangerous riding trajectory are as follows:
[0068] Reverse: The trajectory shown is in the form of a straight line, and the riding direction is the direction indicated by the bicycle icon. The rider maintains a relatively stable driving direction on the road, but does not ride according to the road sign direction marked on the map, so it can be determined that the rider has implemented reverse behavior on this road.
[0069] The corresponding normal riding trajectory feature is that the rider can always maintain a stable driving direction on the corresponding road, and strictly follows the road sign direction marked on the map.
[0070] Crossing the road: The trajectory continuous point does not obviously cross the pedestrian area marked on the map, which indicates that the rider does not cross the road from the pedestrian area according to the normal traffic rules, but adopts the way of crossing the road.
[0071] The corresponding normal riding trajectory feature is that the trajectory continuous point of the shared bicycle clearly crosses the pedestrian area marked on the map, indicating that the rider completes the action of crossing the road from the pedestrian area.
[0072] Illegal left turn: The trajectory shows that when the rider performs a left turn at the intersection, the angle change is relatively smooth, and the rider does not straighten out for a period of time at the intersection to wait for the left turn opportunity according to the normal traffic rules, but directly performs a left turn at the intersection.
[0073] The corresponding normal riding trajectory feature is that when the rider arrives at the intersection and performs a left turn, the trajectory has a significant angle change, and before performing the left turn, the rider first straightens out for a distance at the road section corresponding to the traffic light, and then performs the left turn according to the traffic rules and the intersection traffic conditions.
[0074] In the technical solution of the present application, a shared bicycle dangerous riding behavior detection model constructed by using convolutional neural network technology is taken as an example to be described. The detection model mainly consists of three core parts, namely convolutional layer, pooling layer and fully connected layer, each part undertakes different and key functions in the whole detection process.
[0075] The main function of the convolution layer is to accurately and efficiently extract local features and global features of an image from input image data. By sliding convolution operation on the image with a convolution kernel, feature information of different regions can be captured, laying a solid foundation for subsequent analysis and processing. The main use of the pooling layer is to effectively process data processed by the convolution layer, greatly reducing the parameter order of the data. By using common pooling methods such as max pooling or average pooling, dimensionality reduction and further purification of features are realized under the premise of retaining key feature information, thereby improving the operation efficiency and generalization ability of the entire model. The fully connected layer is mainly responsible for in-depth processing of the "compressed image information" obtained after the pooling layer processing, and finally outputs the corresponding detection result. It establishes a full connection relationship between neurons to comprehensively analyze and judge the feature information, so as to accurately determine the shared bicycle riding behavior corresponding to the input image.
[0076] In the actual detection operation process, the shared bicycle trajectory image accurately matched with the high-precision map is accurately input into the shared bicycle dangerous riding behavior detection model constructed above. Based on its complex and precise operation mechanism, the model carries out comprehensive and in-depth analysis and detection on the shared bicycle riding trajectory corresponding to the input image data.
[0077] After the accurate analysis and detection of the model, three different types of dangerous riding behaviors are successfully identified from the shared bicycle riding trajectory, namely, reverse, crossing the road and illegal left turn.
[0078] The shared bicycle dangerous riding behavior detection method based on image recognition can achieve the following detection indicators:
[0079]
[0080] The accuracy and recall rate data presented above clearly reflect the accuracy of the detection model in identifying different dangerous riding behaviors, providing an important basis for evaluating the effectiveness and reliability of the shared bicycle dangerous riding behavior detection method.
[0081] It should be noted that the above content only illustrates the technical idea of the present application and cannot limit the protection scope of the present application. For ordinary skilled persons in the technical field, without departing from the principles of the present application, a number of improvements and refinements can be made, which fall within the protection scope of the claims of the present application.
Claims
1.A method for detecting dangerous cycling behavior of a shared bicycle based on image recognition, characterized in that: The method comprises the following steps: S1. Obtain shared bicycle riding track data with time stamps; The time stamps are accurate to the second level, each time stamp is an interval time t1, t2, t3...tn, and the time sequence and duration of riding can be accurately reflected; S2. Match the track data to a high-precision map; ensure that the selected high-precision map can accurately present various types of geographic information of roads, intersections and landmarks; Through a matching algorithm, each coordinate point in the obtained shared bicycle riding track data and the corresponding time stamp information are accurately matched with the corresponding position on the high-precision map, so as to realize accurate "landing" of the track data on the map; S3. Preprocess the matched track riding image and extract track feature parameters; S4. Label the extracted track feature parameters as normal riding and dangerous riding tracks; dangerous riding tracks include reverse riding, illegal left turning and crossing the road; S5. Make a training set and a verification set according to the proportion of the feature parameters; the proportion of the training set and the verification set is 7:3; S6. Construct a Mobike dangerous riding behavior detection neural network and initialize the network parameters to obtain a primary Mobike dangerous riding behavior detection neural network; S7. Train the primary Mobike dangerous riding behavior detection neural network through the training set; The training of the primary Mobike dangerous riding behavior detection neural network specifically comprises the following steps: S71: Normalize all data in the training set; S72: Put the processed data into the neural network and sequentially pass through the convolution layer, the pooling layer and the full connection layer; S73: Calculate the loss function of the trained neural network, and adjust the neural network according to the principle of minimum loss function; S8. Put the verification set into the trained Mobike dangerous riding behavior detection neural network for verification, and evaluate the network; S9. Collect shared bicycle track data to be identified and match it with a high-precision map to form an image to be identified, preprocess the image to be identified, and input the preprocessed image to be identified into the completed Mobike dangerous riding behavior detection neural network to obtain a shared bicycle dangerous riding behavior recognition result. 2.The image recognition based detection method for dangerous cycling behavior of shared bikes according to claim 1, characterized in that: The method comprises the following units: A21. Track data acquisition unit: responsible for acquiring shared bicycle riding track data with time stamps through the positioning system of the shared bicycle or other data acquisition devices; A22. Map matching unit: match the obtained track data to a high-precision map, and determine the accurate position of the track on the map by using a map matching algorithm to improve the correlation and accuracy of the track and the map; A23. Image preprocessing and feature extraction unit: perform cleaning, denoising and normalization preprocessing operations on the matched track riding image, and extract key features of the track riding direction in the image; A24. Feature labeling unit: label the extracted track feature parameters as normal riding and dangerous riding tracks; A25. Data set making unit: make a training set and a verification set according to the proportion of the feature parameters, reasonably divide the data set, and ensure that the subsequent model training and verification work can be effectively carried out; A26. A neural network construction and initialization unit: a shared bicycle dangerous riding behavior detection neural network is constructed, and the network parameters thereof are initialized to obtain a primary shared bicycle dangerous riding behavior detection neural network; A 27. A model training unit: the primary shared bicycle dangerous riding behavior detection neural network is trained by using a training set, an optimization algorithm and a loss function are used to continuously adjust the network parameters, and the learning and recognition ability of the network to dangerous riding behavior characteristics is improved; A28. A model verification and evaluation unit: a verification set is put into the trained shared bicycle dangerous riding behavior detection neural network for verification, and the network is evaluated by using evaluation indexes, and the network performance is further optimized according to the evaluation result; A29. A behavior recognition unit: shared bicycle trajectory data to be recognized are collected and matched with a high-precision map to form an image to be recognized, the image to be recognized is preprocessed, and the preprocessed image to be recognized is input into the completed shared bicycle dangerous riding behavior detection neural network to obtain a shared bicycle dangerous riding behavior recognition result. 3.The image recognition-based detection method for dangerous cycling behavior of shared bicycles according to claim 1, characterized in that: In step S3, the image is subjected to size normalization processing to ensure the consistency of the image size in subsequent analysis and processing. 4.The image recognition-based detection method for dangerous cycling behavior of shared bicycles according to claim 2, characterized in that: In the A28, the formula for evaluating the accuracy of the network is: Accuracy = the number of correctly predicted samples / total sample number, and the formula for evaluating the recall rate is: Recall = true positive number / actual dangerous behavior sample number.
Citation Information
Patent Citations
Infrared image electric bicycle target detection method based on improved YOLO v5s
CN115410047A