Model training method and driving behavior detection method

By training and encrypted transmission parameters on the vehicle side of the driving behavior detection model, the data privacy and model accuracy of data in the existing technology are solved, and high -efficiency and safe driving behavior detection is achieved.

CN119358000APending Publication Date: 2025-01-24AVATR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411504041.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The privacy and security of model training data cannot be guaranteed in the prior art, and the trained model is inaccurate when detecting driving behavior.

Method used

On the vehicle side, models related to driving behavior detection are trained, and the trained model parameters are encrypted and transmitted to the server side. The server side determines the detection model used to detect driving behavior by aggregating the parameters uploaded by each vehicle to ensure the privacy and security of user data.

Benefits of technology

It is possible to obtain accurate detection models for detecting various driving behaviors while ensuring the privacy of user data, improving the accuracy of the model and the security of user data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119358000A_ABST
    Figure CN119358000A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of vehicles, and discloses a model training method and a driving behavior detection method, and the model training method comprises the steps: obtaining an encrypted first parameter sent by at least one vehicle, and for each vehicle, obtaining an encrypted second parameter; the first parameter is a parameter obtained by training a first preset model by the vehicle based on the collected driving behavior of the user until convergence, then aggregating the at least one first parameter to obtain a second parameter, and finally determining a detection model for detecting the driving behavior according to the second parameter and a second preset model. The first preset model and the second preset model are consistent in structure. By applying the technical scheme of the invention, the privacy security of the data used for training the model can be ensured, and the model obtained by training is more accurate when detecting the driving behavior.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of vehicle technology, and specifically to a model training method and a driving behavior detection method. Background Art

[0002] With the development of science and technology and economic progress, the number of vehicles has increased year by year, but at the same time, the frequency of traffic accidents has also been on the rise. The main cause of most traffic accidents is the driver's distracted behavior, such as eating, smoking, looking at the phone, making phone calls, etc.

[0003] The detection methods that are currently widely used are generally based on model training. However, since the training process requires a large amount of user data and cannot meet the needs of privacy protection, user data sharing is low, resulting in the inability to obtain accurate detection models in the cloud. Summary of the invention

[0004] In view of the above problems, an embodiment of the present invention provides a model training method and a driving behavior detection method, which are used to solve the problems in the prior art that the privacy security of model training data cannot be guaranteed and the trained model is inaccurate when detecting driving behavior.

[0005] According to one aspect of an embodiment of the present invention, a model training method is provided, which is applied to a server, and the method includes:

[0006] Obtaining an encrypted first parameter sent by at least one vehicle, where for each vehicle, the first parameter is a parameter obtained by training a first preset model based on the collected driving behavior of the user until convergence;

[0007] Aggregating the at least one first parameter to obtain a second parameter;

[0008] A detection model for detecting driving behavior is determined according to the second parameter and the second preset model, and the structure of the first preset model is consistent with the structure of the second preset model.

[0009] According to another aspect of an embodiment of the present invention, a driving behavior detection method is provided, which is applied to a vehicle, and the method includes:

[0010] Obtain the user's target driving behavior;

[0011] The target driving behavior is input into a detection model to obtain a detection result, wherein the detection model is a model trained according to a model training method, and the detection result is used to indicate whether the user's driving meets the safety driving requirements.

[0012] According to another aspect of an embodiment of the present invention, a model training device is provided, which is applied to a server, and the device includes:

[0013] An acquisition module, used to acquire an encrypted first parameter sent by at least one vehicle, wherein for each vehicle, the first parameter is a parameter obtained by training a first preset model based on the collected driving behavior of the user until convergence;

[0014] an aggregation module, configured to aggregate the at least one first parameter to obtain a second parameter;

[0015] A determination module is used to determine a detection model for detecting driving behavior based on the second parameter and a second preset model, and the structure of the first preset model is consistent with the structure of the second preset model.

[0016] According to another aspect of an embodiment of the present invention, there is provided a driving behavior detection device, which is applied to a vehicle, and the device comprises:

[0017] An acquisition module, used to acquire the user's target driving behavior;

[0018] A processing module is used to input the target driving behavior into a detection model to obtain a detection result, wherein the detection model is a model trained according to the model training method in the first aspect, and the detection result is used to indicate whether the user's driving meets the safe driving requirements.

[0019] According to another aspect of an embodiment of the present invention, an electronic device is provided, the electronic device is a vehicle or a server, the electronic device comprises: a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface communicate with each other through the communication bus;

[0020] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of any one of the above methods.

[0021] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a device / apparatus to perform the operation of any one of the above-mentioned methods.

[0022] The embodiment of the present invention trains a driving behavior detection-related model on each vehicle side, and encrypts the parameters of the trained model and transmits them to the server side, so that the server side does not need to obtain user data used by each vehicle, thereby ensuring the privacy and security of user data; then, the server aggregates the parameters uploaded by each vehicle to obtain parameters that can be applied to the detection model, and if the detection model can converge based on the aggregated parameters, then an accurate detection model that can be used to accurately detect various driving behaviors can be obtained.

[0023] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:

[0025] Figure 1 A flow chart of a first embodiment of the model training method provided by the present invention is shown;

[0026] Figure 2 A flow chart showing a second embodiment of the model training method provided by the present invention;

[0027] Figure 3 A flow chart of a third embodiment of the model training method provided by the present invention is shown;

[0028] Figure 4 A flow chart showing a first embodiment of a method for detecting driving behavior provided by the present invention;

[0029] Figure 5 A flow chart showing a second embodiment of the driving behavior detection method provided by the present invention;

[0030] Figure 6 A flowchart of a fourth embodiment of the model training method provided by the present invention is shown;

[0031] Figure 7 A schematic diagram showing the structure of an embodiment of a model training device provided by the present invention is shown;

[0032] Figure 8 A schematic structural diagram of an embodiment of a driving behavior detection device provided by the present invention is shown;

[0033] Fig. 9A schematic structural diagram of an embodiment of the electronic device of the present invention is shown. DETAILED DESCRIPTION

[0034] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0035] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0036] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the embodiments provided herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the embodiments provided below are partial embodiments for implementing the present invention, rather than providing all embodiments for implementing the present invention. In the absence of conflict, the technical solutions recorded in the embodiments of the present invention can be implemented in any combination.

[0037] It should be noted that, in the embodiments of the present invention, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a method or apparatus including a series of elements includes not only the elements explicitly recorded, but also includes other elements not explicitly listed, or also includes elements inherent to the implementation of the method or apparatus. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other related elements (such as steps in a method or modules in an apparatus, such as a module that can be a part of a circuit, a part of a processor, a part of a program or software, etc.) in the method or apparatus including the element.

[0038] For example, the method provided by the embodiment of the present invention includes a series of steps, but the method provided by the embodiment of the present invention is not limited to the steps described in this document. Similarly, the device provided by the embodiment of the present invention includes a series of modules, but the device provided by the embodiment of the present invention is not limited to including the modules explicitly described, and may also include modules required to obtain relevant information or perform processing based on information.

[0039] Before introducing the method involved in the embodiment of the present invention, the application background of the present invention is first explained.

[0040] With the development of science and technology and economic progress, the number of vehicles has increased year by year, but at the same time, the frequency of traffic accidents has also been on the rise. The main cause of most traffic accidents is the driver's distracted driving behavior, such as eating, smoking, looking at the phone, making phone calls, etc. Therefore, identifying the driver's distracted driving behavior and issuing early warnings can eliminate potential accident risks and is an important means to ensure road safety.

[0041] The traditional vehicle detection method that is currently widely used requires manual participation in feature selection and other tasks, has poor generalization ability and low recognition accuracy. The use of emerging target detection technologies, such as the Yolov5 algorithm, can greatly improve recognition accuracy, but it also faces the problem of insufficient training samples due to users' unwillingness to share data for privacy reasons.

[0042] That is, the embodiments of the present invention are intended to solve the following problems existing in the prior art:

[0043] 1. In the prior art, model training requires a large amount of training data. Due to privacy and security considerations, users may not provide the data to the server, which means that the privacy and security of the data cannot be guaranteed.

[0044] 2. Since users refuse to provide data to the server, there is less training data, and the trained model has poor effect and low accuracy.

[0045] Based on the above technical problems, the technical concept of the present invention is as follows: if the user of at least one vehicle refuses to provide data such as driving behavior, then a corresponding training model can be set on the local side of the vehicle, and only the parameters of the trained model can be obtained and transmitted to the server side in an encrypted manner. Then the server side can determine the parameters for building a detection machine learning model in an aggregated manner based on the parameters obtained from each vehicle, thereby obtaining a more accurate detection model. That is, it can meet the needs of privacy protection and fully participate in large sample machine learning to improve the accuracy of the model.

[0046] Furthermore, once the detection model is determined, the user behavior data obtained in real time on the vehicle side can be input into the detection model to determine whether the user is distracted driving, etc., so as to achieve early warning and eliminate potential accident risks to ensure road safety.

[0047] The technical solution of the present invention is described in detail below through specific embodiments. The execution subject of the present invention is an electronic device, which can be a vehicle or a server according to actual conditions, which will be described in detail below.

[0048] It should be noted that the following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0049] Among them, the server involved in the embodiment of the present invention can be an artificial intelligence (AI) cloud server in the cloud.

[0050] Figure 1 FIG. 1 is a flow chart showing a first embodiment of a model training method provided by the present invention, wherein the method is executed by a server. Figure 1 As shown, the method comprises the following steps:

[0051] Step 11, obtaining an encrypted first parameter sent by at least one vehicle;

[0052] Wherein, for each vehicle, the first parameter is a parameter obtained by training the first preset model based on the collected driving behavior of the user until convergence;

[0053] In this step, in order to ensure the security and privacy of the user's driving behavior data, on the vehicle side, the vehicle collects the user's driving behavior to train the first preset model, and after training, the parameters of the trained first preset model, i.e., the first parameters, are encrypted and sent to the server.

[0054] In a possible implementation, the driving behavior may be distracted driving, speeding, fatigue driving, aggressive driving, etc. The embodiment of the present invention is described by taking distracted driving as an example.

[0055] Among them, the relevant data of the user's driving behavior can be based on images obtained by various sensors such as the camera unit in the vehicle; the encryption method can be homomorphic encryption.

[0056] Step 12: Aggregate at least one first parameter to obtain a second parameter;

[0057] In this step, after obtaining the first parameters uploaded by each vehicle, all the parameters are aggregated to form a more comprehensive and robust parameter of the second preset model to adapt to different driving environments and situations, and the second parameter can represent the consistency on all vehicles. The aggregation process can also be the weighted update process described below.

[0058] Optionally, step 12 may include the following steps: determining the upload gradient of at least one first parameter based on at least one first parameter and at least one first parameter uploaded by at least one vehicle before the at least one first parameter; and then obtaining the second parameter based on the upload gradient of at least one first parameter, the current parameters of the second preset model and the number of training samples of the driving behavior of the user corresponding to at least one vehicle.

[0059] In this implementation, the calculation formula for determining the second parameter based on each first parameter may be:

[0060]

[0061] Among them, θ t+1 is the second parameter determined; θ t is the current parameter of the second preset model, that is, the second parameter determined last time; n k is the number of training set samples for the kth vehicle; w k Upload the gradient for the kth vehicle, that is, the difference between the first parameter uploaded by the kth vehicle and the first parameter uploaded by the vehicle last time, and n is the sum of the number of samples in all training sets.

[0062] In one possible implementation, if there is no first parameter of the previous upload, then w k Can be the default value or 1.

[0063] Step 13: Determine a detection model for detecting driving behavior based on the second parameter and the second preset model.

[0064] In this step, after the second parameter is obtained by aggregation, the second parameter is used as a parameter of the second preset model to verify the second preset model to determine whether the second preset model converges.

[0065] If converged, the second preset model is determined to be a detection model for detecting driving behavior; if not converged, the detection model is further determined according to the second parameter and the second preset model. The specific implementation process can be referred to the following embodiment.

[0066] Optionally, the structures of the first preset model on the vehicle side and the second preset model on the server side are consistent, which can reduce the complexity of conversion between different models and simplify model verification and testing.

[0067] In a possible implementation, both the first preset model and the second preset model may be YOLOv5 models constructed with a Block structure, and the Block structure may be SE Block, ECA Block, CA Block, and the like.

[0068] In the model training method provided in the embodiment of the present invention, the server obtains the encrypted first parameter sent by at least one vehicle. For each vehicle, the first parameter is the parameter obtained by training the first preset model based on the collected user driving behavior until convergence, and the at least one first parameter is aggregated to obtain the second parameter. Then, according to the second parameter and the second preset model, the detection model for detecting driving behavior is determined, and the structure of the first preset model is consistent with the structure of the second preset model. In this embodiment, training is performed on the driving behavior detection-related model at each vehicle end, and the parameters of the trained model are transmitted to the server side, so that the server side does not need to obtain the user data used by each vehicle, thereby ensuring the privacy and security of the user data; then, the server aggregates the parameters uploaded by each vehicle to obtain the parameters that can be applied to the detection model, and if the detection model can converge based on the aggregated parameters, then an accurate detection model that can be used to accurately detect various driving behaviors can be obtained.

[0069] Based on the above embodiments, Figure 2 FIG. 2 is a flow chart showing a second embodiment of the model training method provided by the present invention, wherein the method is executed by a server. Figure 2 As shown, the above step 13 may include the following steps:

[0070] It should be understood that step 22 and step 21 are specifically performed according to actual conditions.

[0071] Step 21: When the second parameter is used as a parameter of the second preset model and the second preset model converges, determine the converged second preset model as the detection model.

[0072] In this step, the second parameter is used as the parameter of the second preset model, and the second preset model is tested using a relevant test set of driving behavior to determine whether the second preset model converges. If converged, the converged second preset model is considered to be consistent with the detection of user driving behavior and is recorded as the detection model.

[0073] Step 22: When the second parameter is used as a parameter of the second preset model but the second preset model does not converge, repeat the first preset step until the new second parameter obtained makes the second preset model converge, so as to determine the converged second preset model as the detection model.

[0074] Among them, the first preset step is: sending the second parameter to at least one vehicle, and obtaining a new first parameter encrypted and uploaded by at least one vehicle, and then aggregating based on each new first parameter to obtain a new second parameter; for each vehicle, the new first parameter is the parameter obtained by training the first preset model based on the second parameter and the collected user driving behavior until convergence.

[0075] In this step, if the second parameter is used as the parameter of the second preset model, and the second preset model is tested using a relevant test set of driving behavior to determine whether the second preset model converges, if not, it is considered that the second parameter is not the optimal parameter, and the second parameter needs to be sent to each vehicle so that each vehicle uses the second parameter as the parameter of its first preset model and performs training until the first preset model converges, and then the converged parameters of the first preset model are used as new first parameters and uploaded to the server.

[0076] Furthermore, the server aggregates all the new first parameters (the implementation of aggregation is as described above) to obtain new second parameters, and uses the second parameters as parameters of the second preset model, and determines whether the second preset model converges. The above process is repeated until the second preset model is found to converge after testing, and the new second parameters that are judged to converge are used as parameters of the second preset model, and the second preset model is used as the detection model.

[0077] In the above embodiment, when judging whether the second preset model converges, the following can be performed: at least one sample to be verified is input into the second preset model whose parameter is the second parameter, and an output result corresponding to at least one sample to be verified is obtained, and the at least one output result is used to verify whether the second preset model converges.

[0078] In this implementation, each sample to be verified corresponds to an expected result. Taking driving behavior as an example, the image corresponding to the driving behavior is input, and the expected result is whether the image is distracted driving. Each expected result and the corresponding output result are used to determine whether the second preset model converges.

[0079] Exemplarily, for each sample to be verified, the sample to be verified is input into a second preset model whose parameter is a second parameter to obtain an output result corresponding to the sample to be verified, and specifically the following steps may be performed:

[0080] According to the second parameter, the first weights corresponding to the first image features of the sample to be verified and the respective feature channels in the second preset model are determined; and the output result is determined according to the first feature map corresponding to the sample to be verified and the respective first weights.

[0081] Optionally, the specific implementation of the output result is described by taking the second preset model as a YOLOv5 model built based on the SE Block structure as an example.

[0082] In this implementation, for the YOLOv5 model built with SE Block structure, the model parameters are the second parameters, which include two parts:

[0083] First, YOLOv5 is mainly composed of four structures: input end, backbone network (English: Backbone), neck network (English: Neck) and detection head (English: Head).

[0084] Second, SE Block is an attention operation on the feature channel dimension, which allows the model to pay more attention to the image channel with the largest amount of information and suppress those unimportant channels, thereby achieving better results in model training.

[0085] That is, the specific parameters on each substructure in SE Block YOLOv5 are adjusted to the second parameters accordingly, and the following implementation is performed:

[0086] Specifically, the input end includes three data preprocessing methods: data enhancement, adaptive image scaling, and adaptive anchor frame calculation, which can improve the efficiency of preprocessing samples to be verified and the effect of convergence verification. Backbone is mainly used to extract features of samples to be verified. Neck mixes or combines the extracted first feature map (i.e., the weighted first feature map described below) to form some more complex features, and then sends these features to Head for detection, which outputs the output results of the samples to be verified.

[0087] Among them, SE Block first performs a compression operation Fsq, that is, performs global average pooling on each feature channel of the extracted first image feature to obtain information outside the receptive field. Then an excitation operation Fex is performed, that is, the first weights of different channels are obtained through the Relu function and the sigmoid function. Finally, Fscale is executed, that is, the first weight obtained is multiplied by the first feature map to obtain the weighted first feature map.

[0088] Comprehensive,YOLOv5 model constructed with SE Block structure,In the specific implementation, to insert SEBlock in YOLOv5, it will be added to each residual structure in Backbone,after the convolutional layer.

[0089] The model training method provided by the embodiment of the present invention is that the server determines the converged second preset model as the detection model when the second parameter is used as the parameter of the second preset model and the second preset model converges; when the second parameter is used as the parameter of the second preset model but the second preset model does not converge, the first preset step is repeated until the new second parameter obtained makes the second preset model converge, so as to determine the converged second preset model as the detection model, and the first preset step is: the second parameter is sent to at least one vehicle, and the new first parameter uploaded by at least one vehicle is obtained, and the new second parameter is obtained by aggregating based on each new first parameter; for each vehicle, the new first parameter is the parameter obtained by the vehicle training the first preset model based on the second parameter and the collected driving behavior of the user until convergence. In this embodiment, the second preset model on the server side is continuously updated based on the parameters obtained on the vehicle side, and the parameters determined by the server side can also be used as the initial parameters for the vehicle side training, which can avoid the security and privacy issues such as the transmission of user driving behavior related data, and realize that the relevant data can fully participate in the machine learning of large samples, thereby improving the accuracy of the model.

[0090] Based on the above embodiments, Figure 3 FIG. 4 is a flow chart of a third embodiment of the model training method provided by the present invention, which is executed by a server. Figure 3 As shown, the method may also include the following steps:

[0091] Step 31, obtaining driving behaviors of multiple other users;

[0092] In this step, when the parameters of the second preset model are determined for the first time (i.e., the second parameters sent to each vehicle), relevant training sets of driving behaviors can be obtained from public data sets such as ImageNet and Open Images, that is, not the driving behaviors of users corresponding to each vehicle.

[0093] In this implementation, the driving behavior of the user corresponding to each vehicle is not obtained, which ensures user privacy and security during data transmission.

[0094] Step 32: training the second preset model according to the driving behaviors of multiple other users to obtain initial second parameters sent to at least one vehicle.

[0095] In this step, after obtaining the relevant training set of driving behavior, the second preset model is trained until the second preset model converges, and the parameters of the converged second preset model are used as the second parameters, that is, the second parameters initially sent to each vehicle.

[0096] When the server subsequently sends the second parameter to each vehicle, the second parameter is obtained by aggregating the first parameters uploaded by each vehicle.

[0097] In a possible implementation, when the initial second parameter is sent, the second parameter may be encrypted and sent.

[0098] It should be understood that the training process is similar to the model processing process in the above-mentioned embodiment and will not be described in detail here.

[0099] In the model training method provided in the embodiment of the present invention, the server obtains the driving behaviors of multiple other users, and trains the second preset model according to the driving behaviors of the multiple other users to obtain the initial second parameters sent to at least one vehicle. In this embodiment, the training data obtained by the server comes from the relevant data of the driving behaviors of other users, avoiding the acquisition of data on the vehicle side, thereby avoiding problems such as privacy and security, and providing initial parameters for the model on the vehicle side, thereby improving the efficiency of training.

[0100] Based on the above embodiments, Figure 4 FIG. 1 is a flow chart showing a first embodiment of a method for detecting driving behavior provided by the present invention, the method being executed by any vehicle. Figure 4 As shown, the method may include the following steps:

[0101] Step 41: Obtain the user's target driving behavior;

[0102] In this step, the user's driving behavior can be detected in real time and recorded as the target driving behavior.

[0103] For example, the camera unit acquires an image of the vehicle driver in real time.

[0104] Step 42: input the target driving behavior into the detection model to obtain the detection result;

[0105] Among them, the detection model is a model trained according to the training method of the above model, and the detection result is used to indicate whether the user's driving meets the safety driving requirements.

[0106] In this step, the detection model can be a model located on the server, or the second parameter in the detection model trained on the server can be synchronized to the model obtained in the first preset model in the vehicle, or the detection model can be sent to the vehicle end to provide detection services in real time.

[0107] Therefore, there are two possible implementations in this step:

[0108] First, the vehicle side processes the user's target driving behavior and inputs it into the vehicle side's detection model, which outputs a result indicating whether the user's driving meets the safe driving requirements;

[0109] Second, the target driving behavior is transmitted to the server, which inputs the target driving behavior into the detection model on the vehicle side, outputs a result indicating whether the user's driving meets the safety driving requirements, and then forwards the result to the vehicle.

[0110] Furthermore, based on the detection results, the vehicle can make corresponding response operations.

[0111] For example, when distracted driving behavior is judged, and the safe driving requirement is that the user cannot drive distracted, and the detection result indicates that the user's driving is distracted driving, the vehicle will issue a prompt, such as sending a reminder voice, to assist the user in driving and avoid danger.

[0112] Optionally, the implementation of step 42 may be: determining the second weights corresponding to the second picture features corresponding to the target driving behavior in each image channel in the detection model according to the parameters in the detection model, and then determining the detection result according to the second feature map corresponding to the target driving behavior and each second weight.

[0113] In a possible implementation, the YOLOv5 model (detection model) constructed by the above-mentioned SE Block structure is still taken as an example for description.

[0114] Specifically, the input end includes three data preprocessing methods: data enhancement, adaptive image scaling, and adaptive anchor frame calculation, which can improve the efficiency of preprocessing the target driving behavior and improve the detection effect. Backbone is mainly used to extract features of the target driving behavior. Neck mixes or combines the extracted second feature map (i.e., the weighted second feature map described below) to form some more complex features, and then gives these features to the Head for detection, which outputs the detection results of the target driving behavior.

[0115] Among them, SE Block first performs a squeeze operation Fsq, that is, performs global average pooling on each feature channel of the extracted second image features to obtain information outside the receptive field. Then an excitation operation Fex is performed, that is, the second weights of different channels are obtained through the Relu function and the sigmoid function. Finally, Fscale is executed, that is, the obtained second weight is multiplied by the second feature map to obtain the weighted second feature map.

[0116] In the driving behavior detection method provided in the embodiment of the present invention, the vehicle obtains the target driving behavior of the user and inputs the target driving behavior into the detection model to obtain the detection result, wherein the detection model is a model trained according to the training method of the above model, and the detection result is used to indicate whether the user's driving meets the safe driving requirements. In this embodiment, based on the obtained target driving behavior input into the above model, it can be accurately determined whether the user in the current vehicle is distracted driving.

[0117] Based on the above embodiments, Figure 5 FIG. 2 is a flow chart showing a second embodiment of the method for detecting driving behavior provided by the present invention, the method being executed by any vehicle. Figure 5 As shown, the method may also include the following steps:

[0118] Step 51: Acquire the user's driving behavior and the second parameter sent by the server;

[0119] In this step, the second parameter obtained by the vehicle is based on the progress of the entire training. It can be "the parameter determined by obtaining relevant training sets of driving behavior in the server based on public data sets such as ImageNet and Open Images, and training the second preset model" obtained from the server during the initial training of the vehicle; it can also be "the parameter obtained by aggregating the first parameters obtained by at least one vehicle in the server" obtained from the server during subsequent training of the vehicle.

[0120] In addition, the data related to the user's driving behavior may be based on images acquired by various sensors such as a camera unit in the vehicle.

[0121] Step 52: training the first preset model according to the second parameter and the user's driving behavior to obtain a trained first preset model;

[0122] In this step, after obtaining the second parameter sent by the server, the second parameter is used as the parameter of the first preset model, and then the first preset model is trained based on the obtained user's driving behavior. After a certain number of training rounds (English: epoch), the trained first preset model is obtained.

[0123] Optionally, in the vehicle, the process of training the first preset model can be performed in an intelligent cockpit domain controller (CDC) equipped with a neural network processing unit (NPU) chip, that is, using NPU-assisted calculations designed for neural networks, which can further speed up the training of the model.

[0124] In the actual training process, the driving behavior can be divided into a training set and a test set based on a preprocessing method. Afterwards, the second parameter is used as a parameter of the first preset model, and then the first preset model is trained based on the training set and the test set until the first preset model converges, and the converged first preset model can be obtained.

[0125] It should be understood that the processing process of the first preset model is similar to the model involved in the above embodiment.

[0126] Step 53: Use the trained parameters in the first preset model as the first parameters, and upload them to the server after encryption.

[0127] In this step, after obtaining the trained first preset model, the parameters in the first preset model are used as first parameters and uploaded to the server after being encrypted.

[0128] In this implementation, in order to ensure the security and reliability of data when uploading the first parameter, homomorphic encryption technology can be used to complete the uploading of the first parameter.

[0129] It should be understood that the vehicle in this embodiment is any vehicle in the above embodiments, that is, when the number of vehicles is larger, the number of training samples is larger, and the accuracy of the subsequent detection model is higher.

[0130] In the driving behavior detection method provided in the embodiment of the present invention, the vehicle obtains the user's driving behavior and the second parameter sent by the server, and trains the first preset model according to the second parameter and the user's driving behavior to obtain the trained first preset model, and then uses the parameters in the trained first preset model as the first parameter and uploads it to the server. In this embodiment, the vehicle side uses the local driving behavior data to train the model, and only uploads the parameters of the trained model, so that the server side meets the model training requirements and ensures the privacy protection requirements.

[0131] Based on the above embodiments, Figure 6 A flow chart of a fourth embodiment of the model training method provided by the present invention is shown. Figure 6 As shown, the interaction between the vehicle (vehicle side) and the server (cloud side) is explained. It should be understood that only one vehicle is shown, and in actual implementation, there can be one or more.

[0132] Step 1: Initialize the central model (i.e. the second preset model) in the cloud;

[0133] Step 2: The cloud uses a public data set for pre-training to obtain the initial second parameter and send it to the vehicle.

[0134] Step 3: The vehicle end updates the parameters of the local model (i.e., the first preset model);

[0135] Prior to this, the vehicle receives the data collected by the camera and creates a data set to initialize the local model;

[0136] Step 4: After the vehicle performs training based on the updated local model, the parameters of the trained model (i.e. the encrypted first parameters) are uploaded;

[0137] Among them, vehicle training is implemented in hardware with the assistance of NPU.

[0138] Step 5: Aggregate the first parameter in the cloud;

[0139] Step 6: The cloud inputs the aggregated parameters (new second parameters) into the central model;

[0140] Step 7: The cloud determines whether the central model has converged. If so, execute step 8; if not, execute step 3 (subsequently send the current new second parameter to the vehicle end for update);

[0141] Step 8: End training on the cloud and update model parameters.

[0142] Among them, both the local model and the central model are YOLOv5 models built based on the SE Block structure.

[0143] The model training method provided by the embodiment of the present invention has the following technical effects:

[0144] Technical effect 1. This system uses federated learning to store user data collected by the camera locally and only upload the trained model parameters to the server, which can well protect user privacy. At the same time, each vehicle's local model also has an independent private data set, which can maximize the use of the data set, achieve joint modeling, and improve the performance of the model;

[0145] Technical effect 2: YOLOv5 model is used as the basic model of the central model and local model. YOLOv5 introduces data enhancement technology to improve the robustness of the model. Compared with the existing algorithm, some structures in the network are optimized to make the framework lighter and improve the detection accuracy. And as a single-stage target detection framework, YOLOv5 has a faster detection speed than the two-stage target detection framework, such as Faster R-CNN;

[0146] Technical effect 3: In the YOLOv5 structure, SE Block is added, which can automatically obtain the importance of each channel in the image features through learning, thereby enhancing useful feature channels and suppressing feature channels that are not very useful for the current task, thereby significantly improving the detection effect;

[0147] Technical effect 4. Considering the hardware level of the vehicle, the processing unit NPU designed for neural networks is used to assist in calculations, which further speeds up the training of the model.

[0148] Figure 7 FIG. 1 is a schematic diagram showing a structure of an embodiment of a model training device provided by the present invention. Figure 7 As shown, the device comprises:

[0149] An acquisition module 71 is used to acquire an encrypted first parameter sent by at least one vehicle. For each vehicle, the first parameter is a parameter obtained by training a first preset model based on the collected driving behavior of the user until convergence;

[0150] an aggregation module 72, configured to aggregate at least one first parameter to obtain a second parameter;

[0151] The determination module 73 is used to determine the detection model for detecting the driving behavior according to the second parameter and the second preset model, and the structure of the first preset model is consistent with the structure of the second preset model.

[0152] In one or more embodiments, the determination module 73 is specifically configured to:

[0153] If the second parameter is used as a parameter of the second preset model and the second preset model converges, determining the converged second preset model as the detection model;

[0154] If the second parameter is used as a parameter of the second preset model but the second preset model does not converge, repeating the first preset step until the new second parameter obtained makes the second preset model converge, so as to determine the converged second preset model as the detection model;

[0155] Among them, the first preset step is: sending the second parameter to at least one vehicle, and obtaining a new first parameter encrypted and uploaded by at least one vehicle, and aggregating based on each new first parameter to obtain a new second parameter; for each vehicle, the new first parameter is the parameter obtained by training the first preset model based on the second parameter and the collected user driving behavior until convergence.

[0156] In one or more embodiments, the aggregation module 72 is specifically configured to:

[0157] Determining an upload gradient of at least one first parameter according to at least one first parameter and at least one first parameter uploaded by a vehicle before the at least one first parameter;

[0158] A second parameter is obtained according to an uploaded gradient of at least one first parameter, a current parameter of a second preset model, and a number of training samples of driving behavior of a user corresponding to at least one vehicle.

[0159] In one or more embodiments, the determination module 73 is further configured to:

[0160] Inputting at least one sample to be verified into a second preset model whose parameters are second parameters, obtaining an output result corresponding to the at least one sample to be verified, wherein the at least one output result is used to verify whether the second preset model converges;

[0161] Accordingly, for each sample to be verified, the determination module 73 inputs the sample to be verified into the second preset model with the second parameter as the parameter to obtain the output result corresponding to the sample to be verified, which is specifically used for:

[0162] Determine, according to the second parameter, the first weight corresponding to each feature channel of the first image feature corresponding to the sample to be verified in the second preset model;

[0163] An output result is determined according to the first feature map corresponding to the sample to be verified and each first weight.

[0164] In one or more embodiments, the determination module 73 is further configured to:

[0165] Obtain driving behaviors of multiple other users;

[0166] The second preset model is trained according to the driving behaviors of multiple other users to obtain initial second parameters sent to at least one vehicle.

[0167] From the above, it can be seen that the model training device provided in the embodiment of the present invention, by obtaining the parameters corresponding to the training of the driving behavior detection related model at each vehicle end, makes the device do not need to obtain the user data used by each vehicle, thereby ensuring the privacy and security of the user data; then, according to the parameters uploaded by each vehicle, aggregation is performed to obtain parameters that can be applied to the detection model, and if the detection model can converge based on the aggregated parameters, then an accurate detection model that can be used to accurately detect various driving behaviors can be obtained.

[0168] Figure 8 A schematic structural diagram of an embodiment of a driving behavior detection device provided by the present invention is shown.

[0169] like Figure 8 As shown, the device comprises:

[0170] An acquisition module 81 is used to acquire a user's target driving behavior;

[0171] The processing module 82 is used to input the target driving behavior into the detection model to obtain a detection result. The detection model is a model trained according to the model training method. The detection result is used to indicate whether the user's driving meets the safety driving requirements.

[0172] In one or more embodiments, the acquisition module 81 is further used to: acquire the user's driving behavior and the second parameter sent by the server;

[0173] The processing module 82 is further configured to:

[0174] Training the first preset model according to the second parameter and the user's driving behavior to obtain a trained first preset model;

[0175] The trained parameters in the first preset model are used as the first parameters and uploaded to the server after being encrypted.

[0176] In one or more embodiments, the processing module 82 inputs the target driving behavior into the detection model to obtain a detection result, which is specifically used to:

[0177] Determine, according to the parameters in the detection model, a second weight corresponding to each image channel in the detection model of the second picture feature corresponding to the target driving behavior;

[0178] The detection result is determined according to the second feature map corresponding to the target driving behavior and each second weight.

[0179] From the above, it can be seen that the driving behavior detection device provided in the embodiment of the present invention can obtain accurate detection results by collecting the driving behavior of the user in the vehicle in real time and inputting it into the more accurate detection model determined above.

[0180] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, all or part of them can be integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements. They can also be implemented in the form of hardware. Some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. In addition, all or part of these modules can be integrated together or implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0181] Fig. 9 The schematic diagram of the structure of an embodiment of the electronic device of the present invention is shown, and the specific embodiment of the present invention does not limit the specific implementation of the electronic device.

[0182] like Fig. 9As shown, the electronic device may be a vehicle or a server; it includes: a processor (processor) 902 , a communication interface (Communications Interface) 904 , a memory (memory) 906 , and a communication bus 908 .

[0183] The processor 902, the communication interface 904, and the memory 906 communicate with each other via a communication bus 908. The communication interface 904 is used to communicate with other devices such as a client or other server network elements. The processor 902 is used to execute a program 910, which can specifically execute the relevant steps in the above method embodiment.

[0184] Specifically, the program 910 may include program code, which includes computer-executable instructions.

[0185] The processor 902 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiment of the present invention. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs. They may also be processors of different types, such as one or more CPUs and one or more ASICs.

[0186] The memory 906 is used to store the program 910. The memory 906 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0187] The program 910 can be specifically called by the processor 902 to enable the electronic device to perform the following operations:

[0188] 1. If the electronic device is a server:

[0189] Obtaining an encrypted first parameter sent by at least one vehicle, where for each vehicle, the first parameter is a parameter obtained by training a first preset model based on the collected driving behavior of the user until convergence;

[0190] Aggregating the at least one first parameter to obtain a second parameter;

[0191] A detection model for detecting driving behavior is determined according to the second parameter and the second preset model, and the structure of the first preset model is consistent with the structure of the second preset model.

[0192] In one or more embodiments, determining a detection model for detecting driving behavior according to the second parameter and the second preset model includes:

[0193] If the second parameter is used as a parameter of the second preset model and the second preset model converges, determining the converged second preset model as the detection model;

[0194] If the second parameter is used as a parameter of the second preset model but the second preset model does not converge, repeating the first preset step until the new second parameter obtained makes the second preset model converge, so as to determine the converged second preset model as the detection model;

[0195] Among them, the first preset step is: sending the second parameter to the at least one vehicle, and obtaining the new first parameter encrypted and uploaded by the at least one vehicle, and aggregating based on each new first parameter to obtain a new second parameter; for each vehicle, the new first parameter is the parameter obtained by training the first preset model based on the second parameter and the collected user driving behavior until convergence.

[0196] In one or more embodiments, aggregating the at least one first parameter to obtain the second parameter includes:

[0197] Determining an upload gradient of the at least one first parameter according to the at least one first parameter and the at least one first parameter uploaded by the vehicle before the at least one first parameter;

[0198] The second parameter is obtained according to the uploaded gradient of the at least one first parameter, the current parameter of the second preset model and the number of training samples of the driving behavior of the user corresponding to the at least one vehicle.

[0199] In one or more embodiments, the following is also performed:

[0200] Inputting at least one sample to be verified into the second preset model whose parameters are the second parameters, obtaining an output result corresponding to the at least one sample to be verified, wherein the at least one output result is used to verify whether the second preset model converges;

[0201] Correspondingly, for each sample to be verified, the sample to be verified is input into the second preset model whose parameter is the second parameter, and an output result corresponding to the sample to be verified is obtained, including:

[0202] Determine, according to the second parameter, a first weight corresponding to each feature channel of the first image feature corresponding to the sample to be verified in the second preset model;

[0203] The output result is determined according to the first feature map corresponding to the sample to be verified and each first weight.

[0204] In one or more embodiments, the following is also performed:

[0205] Obtain driving behaviors of multiple other users;

[0206] The second preset model is trained according to the driving behaviors of the multiple other users to obtain initial second parameters sent to the at least one vehicle.

[0207] 2. If the electronic device is a vehicle:

[0208] Obtain the user's target driving behavior;

[0209] The target driving behavior is input into a detection model to obtain a detection result, wherein the detection model is a model trained according to a model training method, and the detection result is used to indicate whether the user's driving meets the safety driving requirements.

[0210] In one or more embodiments, the following is also performed:

[0211] Obtain the user's driving behavior and the second parameter sent by the server;

[0212] Training the first preset model according to the second parameter and the driving behavior of the user to obtain a trained first preset model;

[0213] The trained parameters in the first preset model are used as first parameters and uploaded to the server after being encrypted.

[0214] In one or more embodiments, inputting the target driving behavior into a detection model to obtain a detection result includes:

[0215] Determine, according to the parameters in the detection model, a second weight corresponding to each image channel in the detection model of the second picture feature corresponding to the target driving behavior;

[0216] The detection result is determined according to the second feature map corresponding to the target driving behavior and each second weight.

[0217] From the above, it can be seen that the electronic device provided by the embodiment of the present invention, when acting as a server, can obtain the parameters corresponding to the training of the driving behavior detection-related model at each vehicle end, so that the device does not need to obtain the user data used by each vehicle, thereby ensuring the privacy and security of the user data; further, according to the parameters uploaded by each vehicle, aggregation is performed to obtain parameters that can be applied to the detection model, and if the detection model can converge based on the aggregated parameters, then an accurate detection model that can be used to accurately detect various driving behaviors can be obtained. When acting as a vehicle, accurate detection results can be obtained by collecting the driving behavior of users in the vehicle in real time and inputting it into the more accurate detection model determined above.

[0218] An embodiment of the present invention provides a computer-readable storage medium, which stores at least one executable instruction. When the executable instruction is executed on a device / electronic device, the device / electronic device executes a method in any of the above method embodiments.

[0219] The executable instructions may be used to cause the device / electronic device to perform the following operations:

[0220] 1. When the electronic device is a server, or the device is a model training device:

[0221] Obtaining an encrypted first parameter sent by at least one vehicle, where for each vehicle, the first parameter is a parameter obtained by training a first preset model based on the collected driving behavior of the user until convergence;

[0222] Aggregating the at least one first parameter to obtain a second parameter;

[0223] A detection model for detecting driving behavior is determined according to the second parameter and the second preset model, and the structure of the first preset model is consistent with the structure of the second preset model.

[0224] In one or more embodiments, determining a detection model for detecting driving behavior according to the second parameter and the second preset model includes:

[0225] If the second parameter is used as a parameter of the second preset model and the second preset model converges, determining the converged second preset model as the detection model;

[0226] If the second parameter is used as a parameter of the second preset model but the second preset model does not converge, repeating the first preset step until the new second parameter obtained makes the second preset model converge, so as to determine the converged second preset model as the detection model;

[0227] Among them, the first preset step is: sending the second parameter to the at least one vehicle, and obtaining the new first parameter encrypted and uploaded by the at least one vehicle, and aggregating based on each new first parameter to obtain a new second parameter; for each vehicle, the new first parameter is the parameter obtained by training the first preset model based on the second parameter and the collected user driving behavior until convergence.

[0228] In one or more embodiments, aggregating the at least one first parameter to obtain the second parameter includes:

[0229] Determining an upload gradient of the at least one first parameter according to the at least one first parameter and the at least one first parameter uploaded by the vehicle before the at least one first parameter;

[0230] The second parameter is obtained according to the uploaded gradient of the at least one first parameter, the current parameter of the second preset model and the number of training samples of the driving behavior of the user corresponding to the at least one vehicle.

[0231] In one or more embodiments, the following is also performed:

[0232] Inputting at least one sample to be verified into the second preset model whose parameters are the second parameters, obtaining an output result corresponding to the at least one sample to be verified, wherein the at least one output result is used to verify whether the second preset model converges;

[0233] Correspondingly, for each sample to be verified, the sample to be verified is input into the second preset model whose parameter is the second parameter, and an output result corresponding to the sample to be verified is obtained, including:

[0234] Determine, according to the second parameter, a first weight corresponding to each feature channel of the first image feature corresponding to the sample to be verified in the second preset model;

[0235] The output result is determined according to the first feature map corresponding to the sample to be verified and each first weight.

[0236] In one or more embodiments, the following is also performed:

[0237] Obtain driving behaviors of multiple other users;

[0238] The second preset model is trained according to the driving behaviors of the multiple other users to obtain initial second parameters sent to the at least one vehicle.

[0239] 2. When the electronic device is a vehicle, or the device is a driving behavior detection device:

[0240] Obtain the user's target driving behavior;

[0241] The target driving behavior is input into a detection model to obtain a detection result, wherein the detection model is a model trained according to a model training method, and the detection result is used to indicate whether the user's driving meets the safety driving requirements.

[0242] In one or more embodiments, the method further comprises:

[0243] Obtain the user's driving behavior and the second parameter sent by the server;

[0244] Training the first preset model according to the second parameter and the driving behavior of the user to obtain a trained first preset model;

[0245] The trained parameters in the first preset model are used as the first parameters and uploaded to the server after being encrypted.

[0246] In one or more embodiments, inputting the target driving behavior into a detection model to obtain a detection result includes:

[0247] Determine, according to the parameters in the detection model, a second weight corresponding to each image channel in the detection model of the second picture feature corresponding to the target driving behavior;

[0248] The detection result is determined according to the second feature map corresponding to the target driving behavior and each second weight.

[0249] As can be seen from the above, the execution instructions in the computer-readable storage medium provided by the embodiment of the present invention can specifically obtain the parameters corresponding to the training of the driving behavior detection related model at each vehicle end, so that the device does not need to obtain the user data used by each vehicle, ensuring the privacy and security of the user data; then, according to the parameters encrypted and uploaded by each vehicle, aggregation is performed to obtain parameters that can be applied to the detection model, and if the detection model can converge based on the aggregated parameters, then an accurate detection model that can be used to accurately detect various driving behaviors can be obtained. And by collecting the driving behavior of users in the vehicle in real time and inputting it into the more accurate detection model determined above, accurate detection results can be obtained.

[0250] An embodiment of the present invention provides a computer program product, including a computer program, which implements the operations of the above method when executed by a processor.

[0251] Its implementation principle and technical effects are shown in the above disclosure.

[0252] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0253] The methods disclosed in the various method embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments.

[0254] The features disclosed in the various product embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new product embodiments.

[0255] The features disclosed in the various method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0256] It should be noted that the computer-readable storage medium may be a ROM, a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM), etc. It may also be various devices including one or any combination of the above memories, such as a mobile phone, a computer, a flat-panel vehicle, a personal digital assistant, etc.

[0257] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0258] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0259] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus necessary general hardware nodes, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a device (which can be a mobile phone, a computer, a server, an air conditioner, a vehicle-mounted terminal or a network vehicle, etc.) to execute the methods described in the various embodiments of the present invention.

[0260] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices, apparatuses, and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as a combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0261] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing vehicle to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, the instruction device implementing the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0262] These computer program instructions may also be loaded onto a computer or other programmable device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0263] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A model training method, characterized in that: Applied to a server, the method comprises: Obtaining an encrypted first parameter sent by at least one vehicle, where for each vehicle, the first parameter is a parameter obtained by training a first preset model based on the collected driving behavior of the user until convergence; Aggregating the at least one first parameter to obtain a second parameter; A detection model for detecting driving behavior is determined according to the second parameter and the second preset model, and the structure of the first preset model is consistent with the structure of the second preset model.

2. The method according to claim 1, characterized in that The step of determining a detection model for detecting driving behavior according to the second parameter and the second preset model includes: If the second parameter is used as a parameter of the second preset model and the second preset model converges, determining the converged second preset model as the detection model; If the second parameter is used as a parameter of the second preset model but the second preset model does not converge, repeating the first preset step until the new second parameter obtained makes the second preset model converge, so as to determine the converged second preset model as the detection model; Among them, the first preset step is: sending the second parameter to the at least one vehicle, and obtaining the new first parameter encrypted and uploaded by the at least one vehicle, and aggregating based on each new first parameter to obtain a new second parameter; for each vehicle, the new first parameter is the parameter obtained by training the first preset model based on the second parameter and the collected user driving behavior until convergence.

3. The method according to claim 1 or 2, characterized in that: The aggregating the at least one first parameter to obtain the second parameter includes: Determining an upload gradient of the at least one first parameter according to the at least one first parameter and the at least one first parameter uploaded by the vehicle before the at least one first parameter; The second parameter is obtained according to the uploaded gradient of the at least one first parameter, the current parameter of the second preset model and the number of training samples of the driving behavior of the user corresponding to the at least one vehicle.

4. The method according to claim 2, characterized in that: The method further comprises: Inputting at least one sample to be verified into the second preset model whose parameters are the second parameters, obtaining an output result corresponding to the at least one sample to be verified, wherein the at least one output result is used to verify whether the second preset model converges; Correspondingly, for each sample to be verified, the sample to be verified is input into the second preset model whose parameter is the second parameter, and an output result corresponding to the sample to be verified is obtained, including: Determine, according to the second parameter, a first weight corresponding to each feature channel of the first image feature corresponding to the sample to be verified in the second preset model; The output result is determined according to the first feature map corresponding to the sample to be verified and each first weight.

5. The method according to claim 1 or 2, characterized in that: The method further comprises: Obtain driving behaviors of multiple other users; The second preset model is trained according to the driving behaviors of the multiple other users to obtain initial second parameters sent to the at least one vehicle.

6. A method for detecting driving behavior, characterized in that: Applied to a vehicle, the method comprises: Obtain the user's target driving behavior; The target driving behavior is input into a detection model to obtain a detection result, wherein the detection model is a model trained according to the method according to any one of claims 1 to 5, and the detection result is used to indicate whether the user's driving meets the safety driving requirements.

7. The method according to claim 6, characterized in that The method further comprises: Obtain the user's driving behavior and the second parameter sent by the server; Training the first preset model according to the second parameter and the driving behavior of the user to obtain a trained first preset model; The trained parameters in the first preset model are used as first parameters and uploaded to the server after being encrypted.

8. The method according to claim 6 or 7, characterized in that: The step of inputting the target driving behavior into a detection model to obtain a detection result includes: Determine, according to the parameters in the detection model, a second weight corresponding to each image channel in the detection model of the second picture feature corresponding to the target driving behavior; The detection result is determined according to the second feature map corresponding to the target driving behavior and each second weight.

9. A model training device, characterized in that: Applied to a server, the device comprises: An acquisition module, used to acquire an encrypted first parameter sent by at least one vehicle, wherein for each vehicle, the first parameter is a parameter obtained by training a first preset model based on the collected driving behavior of the user until convergence; an aggregation module, configured to aggregate the at least one first parameter to obtain a second parameter; A determination module is used to determine a detection model for detecting driving behavior based on the second parameter and a second preset model, and the structure of the first preset model is consistent with the structure of the second preset model.

10. A driving behavior detection device, characterized in that: Applied to a vehicle, the device comprises: An acquisition module, used to acquire the user's target driving behavior; A processing module is used to input the target driving behavior into a detection model to obtain a detection result, wherein the detection model is a model trained according to any one of the model training methods according to claims 1 to 5, and the detection result is used to indicate whether the user's driving meets the safe driving requirements.