Method and apparatus for detecting attention
By utilizing attention mechanisms and supervised learning based on gaze and head posture features in the cloud, the problem of insufficient tolerance in vehicle-side detection models was solved, improving the accuracy and speed of driver attention detection.
Patent Information
- Application Number
- CN202211117447.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2042-09-14
AI Technical Summary
Existing driver attention detection models on the vehicle side have poor tolerance, resulting in low detection accuracy and failing to fully leverage the advantages of deep learning models.
By receiving multiple frames of driver images sent from the vehicle via the cloud, a detection model based on an attention mechanism is used for supervised learning. Combined with gaze and head posture features, a total loss function is constructed for training, thereby improving the model's parallel computing capabilities and detection accuracy.
This improved the training speed and accuracy of the attention detection model, fully leveraging the algorithmic advantages of deep learning models and enhancing the reliability of the detection results.
Smart Images

Figure CN115546863B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of safe driving technology, and in particular to an attention detection method and device. Background Technology
[0002] With the development of technology, intelligent electronic devices such as smartphones, tablets, and vehicle information systems have greatly increased the probability of drivers becoming distracted, easily creating safety hazards and causing traffic accidents that endanger lives and property. Because vision-based driver attention detection methods can non-invasively extract the driver's visual image information and are unaffected by external interference, visual features are the most widely used information in driver attention detection methods.
[0003] Currently, most methods for detecting driver attention status involve directly classifying raw images using on-vehicle detection models. However, on-vehicle systems have poor tolerance for deep learning models and require consideration of deployment on in-vehicle chips, which prevents them from fully utilizing the model's advantages and can easily lead to inaccurate detection results. Summary of the Invention
[0004] This invention provides an attention detection method and apparatus to address the shortcomings of existing technologies where model detection accuracy is poor due to limitations imposed by the vehicle end, thereby improving detection precision and efficiency.
[0005] This invention provides an attention detection method, comprising: acquiring a series of consecutive driver images; inputting the series of consecutive driver images into an attention detection model to obtain an attention detection result output by the attention detection model; wherein the attention detection model is based on an attention mechanism and is obtained by supervised learning of training images using gaze and head posture.
[0006] According to an attention detection method provided by the present invention, the attention detection model includes: a feature extraction layer for extracting features from the driver image to obtain a feature map; and an attention detection layer for performing attention detection on the feature map to obtain attention detection results, gaze features, and head posture features.
[0007] According to an attention detection method provided by the present invention, attention detection is performed on the feature map to obtain attention detection results, gaze features, and head posture features, including: obtaining gaze features and head posture features based on the attention mechanism and the feature map; obtaining an attention score based on the gaze features and the head posture features; mapping the attention score to a probability value, and obtaining the attention detection result based on the maximum probability value.
[0008] According to an attention detection method provided by the present invention, training the attention detection model includes: acquiring training images within a target time period and ground truth values of attention, gaze, and head pose corresponding to the training images; using the training images as input data for training, and combining the ground truth values of attention, gaze, and head pose to perform supervised training on the attention detection model to be trained, thereby obtaining a trained attention detection model.
[0009] According to an attention detection method provided by the present invention, obtaining a trained attention detection model includes: inputting the training image into the attention detection model to be trained to obtain the attention prediction result, gaze prediction result, and head pose prediction result output by the attention detection model to be trained; constructing a first loss function based on the attention prediction result and the attention ground truth; constructing a second loss function based on the gaze prediction result and the gaze ground truth; constructing a third loss function based on the head pose prediction result and the head pose ground truth; obtaining a total loss function based on the first loss function, the second loss function, and the third loss function, and converging based on the total loss function to terminate training and obtain a trained attention detection model.
[0010] According to an attention detection method provided by the present invention, the attention detection model to be trained includes: a feature extraction layer for extracting features from the training image to obtain target features; an attention detection layer for performing attention detection on the target features to obtain attention prediction results, gaze prediction features, and head pose prediction features; and a target detection layer for obtaining gaze prediction results and head pose prediction results based on the gaze prediction features and the head pose prediction features.
[0011] According to an attention detection method provided by the present invention, after obtaining the attention detection result output by the attention detection model, the method further includes: sending the attention detection result to the vehicle terminal so that the vehicle terminal can perform corresponding measures based on the attention detection result.
[0012] The present invention also provides an attention detection device, comprising: a data acquisition module for acquiring a series of consecutive driver images; and an attention detection module for inputting the series of consecutive driver images into an attention detection model to obtain an attention detection result output by the attention detection model; wherein the attention detection model is based on an attention mechanism and is obtained by supervised learning of training images using gaze and head posture.
[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the attention detection methods described above.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the attention detection methods described above.
[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the attention detection methods described above.
[0016] The attention detection method and apparatus provided by this invention receive multiple consecutive driver images sent from the vehicle via the cloud, and use the cloud-based attention detection model to detect the driver images. By leveraging the cloud's high tolerance for the computational load of the deep learning model, the advantages of the algorithm can be fully utilized. In addition, based on the attention mechanism, the attention detection model is supervised and trained using gaze and head posture to significantly improve cloud performance. By adopting the attention mechanism, the parallel computing capability of the model is enhanced, thereby improving the training speed and accuracy of the model. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating the attention detection method provided by the present invention;
[0019] Figure 2 This is a schematic diagram of the process for training the attention detection model to be trained provided by the present invention;
[0020] Figure 3 This is a schematic diagram of the attention detection model to be trained provided by the present invention;
[0021] Figure 4 This is a schematic diagram of the attention detection device provided by the present invention;
[0022] Figure 5 This is a schematic diagram of the training module provided by the present invention;
[0023] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0025] Figure 1 This diagram illustrates a flowchart of an attention detection method according to the present invention. The method is executed in the cloud and includes:
[0026] S11, acquire consecutive multi-frame driver images;
[0027] S12, input multiple consecutive frames of driver images into the attention detection model to obtain the attention detection result output by the attention detection model; the attention detection model is based on the attention mechanism and is obtained by supervised learning of the training images using gaze and head posture.
[0028] It should be noted that S1N in this specification does not represent the order of attention detection methods. The attention detection method of the present invention will be described in detail below.
[0029] Step S11: Acquire consecutive multi-frame driver images.
[0030] In this embodiment, the continuous multi-frame driver images can be a video stream or a sequence of continuously captured driver image frames. When the continuous multi-frame driver images are a video stream, after receiving the driver images within a preset time period sent by the vehicle terminal, the method further includes: performing shot segmentation based on the video stream to obtain continuous multi-frame driver images.
[0031] Step S12: Input multiple consecutive frames of driver images into the attention detection model to obtain the attention detection result output by the attention detection model; the attention detection model is based on the attention mechanism and is obtained by supervised learning of the training images using gaze and head pose.
[0032] In this embodiment, the attention detection model includes: a feature extraction layer for extracting features from the driver image to obtain a feature map; and an attention detection layer for performing attention detection on the feature map to obtain attention detection results, gaze features, and head pose features. In other words, inputting multiple consecutive frames of driver images into the attention detection model includes: inputting multiple consecutive frames of driver images into the feature extraction layer to obtain a feature map output by the feature extraction layer; and inputting the feature map into the attention detection layer to obtain the attention detection results, gaze features, and head pose features output by the attention detection layer.
[0033] It should be noted that the attention mechanism can employ the transformer mechanism. By using the attention mechanism, the parallel computing capability of the model is improved, thereby increasing the training speed. In addition, the transformer can better handle the dependencies between data in long sequences. Furthermore, attention prediction results include both distracted and focused attention.
[0034] In an optional embodiment, attention detection is performed on the feature map to obtain attention detection results, gaze features, and head pose features, including: obtaining gaze features and head pose features based on the attention mechanism and the feature map; obtaining an attention score based on the gaze features and head pose features; mapping the attention score to a probability value, and obtaining the attention detection result based on the maximum probability value.
[0035] refer to Figure 2 In one optional embodiment, before inputting consecutive multi-frame driver images into the attention detection model, the method further includes: training the attention detection model. Specifically:
[0036] S21, obtain the training images within the target time period and the ground truth values of attention, gaze, and head pose corresponding to the training images;
[0037] S22, the training images are used as input data for training, and the attention detection model to be trained is supervised by combining the ground truth of attention, gaze, and head pose, so as to obtain the trained attention detection model.
[0038] It should be noted that S2N in this specification does not represent the order of attention detection methods. The following details will explain this in conjunction with... Figure 3 The attention detection method of the present invention is described.
[0039] Step S21: Obtain the training images within the target time period and the ground truth values of attention, gaze, and head pose corresponding to the training images.
[0040] In this embodiment, obtaining training images within a target time period and the corresponding ground truth values for attention, gaze, and head pose includes: acquiring training video or image frame sequences and using a face detection method to filter out videos or images containing face information as valid training images; and annotating the valid training images to obtain ground truth values for attention, gaze, and head pose.
[0041] It should be added that when acquiring training videos or image frame sequences, they can be acquired from the cloud, or different vehicles can be used to record the driving behavior of different drivers in different driving environments, recording videos of different drivers' focused and distracted attention.
[0042] To avoid redundancy between adjacent frames in the video, after acquiring the training video or image frame sequence, the method further includes: acquiring one frame image from the training video or image frame sequence at a preset frame interval based on a preset number of frames.
[0043] In an optional embodiment, after acquiring the training video, the method further includes: performing shot segmentation based on the video to obtain an image frame sequence; and selecting images that meet a preset number of frames before and after the current frame training image based on the image frame sequence, for example, selecting five frames before and after the current frame as training images.
[0044] In an optional embodiment, after obtaining the image frame sequence, the method further includes: performing face detection on each image in the image frame sequence, and removing images that do not contain face information to obtain training images.
[0045] In an optional embodiment, after acquiring the training images within the target time period, the method further includes: performing data augmentation on the training images using a data augmentation strategy. Specifically, the data augmentation strategy includes at least one of flipping, rotating, cropping, deforming, and scaling; and / or, the data augmentation strategy includes at least one of noise reduction, blurring, color transformation, erasing, and filling. It should be noted that the data augmentation strategy selected based on this embodiment is suitable for performing data augmentation on the aforementioned training images, so as to increase the amount of training image data and significantly improve the model's keypoint detection accuracy in scenarios such as lighting, occlusion, incompleteness, large deflection angles, and facial expressions during subsequent model training.
[0046] Step S22: Use the training images as input data for training, and combine the ground truth values of attention, gaze, and head pose to supervise the training of the attention detection model, thereby obtaining the trained attention detection model.
[0047] In this embodiment, the network to be trained can be an existing network built into the training device. This existing network typically includes a network structure, or it can be another network specified by the user, such as a convolutional neural network (CNN). The network to be trained typically includes a feature extraction layer for extracting features from the training images, an attention detection layer for performing attention detection based on the feature maps obtained from the feature extraction layer, a target detection layer for detecting targets based on the attention prediction results obtained from the attention detection layer, and a loss function. According to a preset iteration rule, the above-mentioned training images or data-enhanced training images are input into the attention detection model to be trained for training, thereby obtaining the trained target recognition model.
[0048] Specifically, the completed attention detection model includes:
[0049] First, the training images are input into the attention detection model to be trained, and the attention prediction results, gaze prediction results, and head pose prediction results output by the attention detection model are obtained.
[0050] It should be added that, for reference Figure 3 The attention detection model to be trained includes: a feature extraction layer, which extracts features from the training image to obtain target features; an attention detection layer (encoder), which performs attention detection on the target features to obtain attention prediction results, gaze prediction features, and head pose prediction features; and a target detection layer (decoder), which obtains gaze prediction results and head pose prediction results based on the gaze prediction features and head pose prediction features.
[0051] Furthermore, attention detection is performed on the target features to obtain attention prediction results, gaze prediction features, and head pose prediction features, including: obtaining gaze prediction features and head pose prediction features based on the attention mechanism and target features; obtaining attention prediction scores based on gaze prediction features and head pose prediction features; mapping the attention prediction scores to probability values, and obtaining attention prediction results based on the maximum probability value.
[0052] It should be added that the attention prediction results include normal driving and distraction, which can be labeled with different values. For example, normal driving can be recorded as 0 and distraction as 1.
[0053] Since line of sight includes pitch and yaw, different line-of-sight predictions can be obtained based on different pitch and yaw values. For example, when pitch > 20, the line-of-sight prediction is downward, denoted as category 1; when pitch < -20, the line-of-sight prediction is upward, denoted as category 2; when yaw > 30, the line-of-sight prediction is leftward, denoted as category 3; when yaw < -30, the line-of-sight prediction is rightward, denoted as category 4; and in all other cases, the line-of-sight prediction is forward, denoted as category 0.
[0054] Similarly, since head posture also includes pitch and yaw, different head posture prediction results can be obtained based on different head postures (pitch and yaw). For example, when pitch > 15, the head posture prediction result is head down, denoted as category 1; when pitch < -30, the head posture prediction result is head up, denoted as category 2; when yaw > 30, the head posture prediction result is left turn, denoted as category 3; when yaw < -30, the head posture prediction result is right turn, denoted as category 4; in other cases, the head posture prediction result is normal posture, denoted as category 0.
[0055] Secondly, a first loss function is constructed based on the attention prediction results and the ground truth of attention; a second loss function is constructed based on the gaze prediction results and the gaze ground truth; and a third loss function is constructed based on the head pose prediction results and the head pose ground truth.
[0056] In this embodiment, the first loss function loss_distract, the second loss function loss_gaze, and the third loss function loss_headpose can all be cross-entropy loss functions or other loss functions, and no further limitations are imposed here.
[0057] Finally, based on the first loss function, the second loss function, and the third loss function, the total loss function is obtained. The training ends when the total loss function converges, and the trained attention detection model is obtained.
[0058] In this embodiment, the total loss function loss_total is expressed as:
[0059] loss_total=loss_distract+loss_gaze+loss_headpose
[0060] In an optional embodiment, after obtaining the attention detection result output by the attention detection model, the method further includes: sending the attention detection result to the vehicle terminal so that the vehicle terminal can execute corresponding measures based on the attention detection result. It should be noted that the corresponding measures can be determined according to actual design requirements. For example, when the attention detection result is inattentiveness, a warning can be issued first. If the attention detection result remains inattentiveness after a certain period of time, the vehicle braking is controlled and an alarm is triggered; if the attention detection result is focused after a certain period of time, the warning is canceled.
[0061] In summary, this embodiment of the invention receives multiple consecutive driver images sent from the vehicle via the cloud, and uses a cloud-based attention detection model to detect the driver images. By leveraging the cloud's high tolerance for the computational load of deep learning models, the advantages of the algorithm are fully utilized. Furthermore, based on the attention mechanism, and using gaze and head posture for supervised training of the attention detection model, cloud performance is significantly improved. By adopting the attention mechanism, the parallel computing capability of the model is enhanced, thereby improving the training speed and accuracy of the model.
[0062] The attention detection device provided by the present invention will be described below. The attention detection device described below can be referred to in correspondence with the attention detection method described above.
[0063] Figure 4 An attention detection device is shown, the device comprising:
[0064] Data acquisition module 41 acquires multiple consecutive frames of driver images;
[0065] The attention detection module 42 inputs multiple consecutive frames of driver images into the attention detection model to obtain the attention detection results output by the attention detection model. The attention detection model is based on the attention mechanism and is obtained by supervised learning of the training images using gaze and head posture.
[0066] In this embodiment, the continuous multi-frame driver images can be a video stream or a sequence of continuously captured driver image frames. When the continuous multi-frame driver images are a video stream, the device further includes an image acquisition device, which performs shot segmentation based on the video stream after the data receiving module 41 receives the continuous multi-frame driver images sent by the vehicle end to obtain the continuous frame driver images.
[0067] In addition, the attention detection module 42 includes a data input unit, an attention detection model unit, and a data output unit, wherein: the data input unit inputs multiple consecutive frames of driver images into the attention detection model unit; the attention detection model unit performs attention detection on the input driver images to obtain attention detection results; and the data output unit outputs the attention detection results obtained by the attention detection model unit.
[0068] Furthermore, the attention detection model unit includes: a feature acquisition subunit, which inputs multiple consecutive frames of driver images into the feature extraction layer to obtain the feature map output by the feature extraction layer; and a result acquisition subunit, which inputs the feature map into the attention detection layer to obtain the attention detection result, gaze features, and head pose features output by the attention detection layer.
[0069] Furthermore, the result acquisition subunit includes: a feature acquisition subunit, which obtains gaze features and head pose features based on the attention mechanism and feature map; a score evaluation subunit, which obtains the attention score based on the gaze features and head pose features; and an attention detection subunit, which maps the attention score to a probability value and obtains the attention detection result based on the maximum probability value.
[0070] In an alternative embodiment, the apparatus further includes a training module for training an attention detection model before the data input unit inputs consecutive multi-frame driver images to the attention detection model unit.
[0071] Specifically, refer to Figure 5The training module includes: a data acquisition unit 51, which acquires training images within the target time period and the corresponding ground truth values for attention, gaze, and head pose within the training images; and a training unit 52, which uses the training images as input data for training and combines the ground truth values for attention, gaze, and head pose with the ground truth values for attention to perform supervised training on the attention detection model to be trained, thereby obtaining the trained attention detection model.
[0072] The data acquisition unit 51 includes: a data acquisition subunit, which acquires training video or image frame sequences and uses a face detection method to filter out videos or images containing face information as valid training images; and an annotation subunit, which annotates the valid training images to obtain attention ground truth, gaze ground truth, and head pose ground truth.
[0073] In an optional embodiment, to avoid redundancy between adjacent video frames, the training module further includes: an acquisition unit, which, after the data acquisition subunit acquires the training video or image frame sequence, acquires one frame of image from the training video or image frame sequence at a preset frame interval based on a preset number of frames.
[0074] In another optional embodiment, the training module further includes: a segmentation unit, which performs shot segmentation based on the video after the data acquisition subunit acquires the training video to obtain an image frame sequence; and a selection unit, which selects images that meet a preset number of frames before and after the current frame training image based on the image frame sequence, for example, selecting five frames before and after the current frame as training images.
[0075] In an optional embodiment, the training module further includes: a filtering unit, which performs face detection on each frame in the image frame sequence after the data acquisition unit obtains the image frame sequence or the segmentation unit obtains the image frame sequence, and removes images that do not contain face information to obtain training images.
[0076] In an optional embodiment, the training module further includes a data augmentation unit, which, after acquiring training images within a target time period, performs data augmentation on the training images using a data augmentation strategy.
[0077] Training unit 52 includes: a prediction subunit, which inputs training images into the attention detection model to be trained and obtains the attention prediction result, gaze prediction result, and head pose prediction result output by the attention detection model to be trained; a loss function construction subunit, which constructs a first loss function based on the attention prediction result and the attention ground truth; constructs a second loss function based on the gaze prediction result and the gaze ground truth; and constructs a third loss function based on the head pose prediction result and the head pose ground truth; and a model determination subunit, which obtains a total loss function based on the first loss function, the second loss function, and the third loss function, and converges based on the total loss function, ending the training and obtaining the trained attention detection model.
[0078] Specifically, the prediction subunit includes: a feature extraction subunit, which extracts features from the training image to obtain target features; an attention detection subunit (encoder), which performs attention detection on the target features to obtain attention prediction results, gaze prediction features, and head pose prediction features; and a target detection subunit (decoder), which obtains gaze prediction results and head pose prediction results based on the gaze prediction features and head pose prediction features.
[0079] Furthermore, the attention detection grandchild unit includes: a feature determination grandchild unit, which obtains gaze prediction features and head pose prediction features based on the attention mechanism and target features; a score determination grandchild unit, which obtains the attention prediction score based on the gaze prediction features and head pose prediction features; and a result determination grandchild unit, which maps the attention prediction score to a probability value and obtains the attention prediction result based on the maximum probability value.
[0080] In an optional embodiment, the device further includes a result sending module, which sends the attention detection result to the vehicle after the attention detection module obtains the attention detection result output by the attention detection model, so that the vehicle can execute corresponding measures based on the attention detection result. It should be noted that the corresponding measures can be determined according to actual design requirements. For example, when the attention detection result is inattentiveness, a warning can be issued first. If the attention detection result remains inattentiveness after a certain period of time, the vehicle braking is controlled and an alarm is triggered; if the attention detection result is focused after a certain period of time, the warning is canceled.
[0081] In summary, this embodiment of the invention receives multiple consecutive driver images sent from the vehicle via a cloud-based data receiving module. The cloud-based attention detection module then detects the driver images based on an attention detection model. The cloud's high tolerance for the computational demands of deep learning models allows for full utilization of the algorithm's advantages. Furthermore, based on an attention mechanism, and utilizing gaze and head posture for supervised training of the attention detection model, cloud performance is significantly improved. By employing an attention mechanism, the model's parallel computing capability is enhanced, thereby increasing the model's training speed and accuracy.
[0082] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6 As shown, the electronic device may include a processor 61, a communications interface 62, a memory 63, and a communication bus 64. The processor 61, communications interface 62, and memory 63 communicate with each other via the communication bus 64. The processor 61 can call logical instructions in the memory 63 to execute an attention detection method. This method includes: acquiring multiple consecutive frames of driver images; inputting the multiple consecutive frames of driver images into an attention detection model to obtain the attention detection result output by the attention detection model; the attention detection model is based on an attention mechanism and is obtained through supervised learning of training images using gaze and head pose.
[0083] Furthermore, the logical instructions in the aforementioned memory 63 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0084] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the attention detection method provided by the above methods. The method includes: acquiring a series of consecutive driver images; inputting the consecutive multiple driver images into an attention detection model to obtain the attention detection result output by the attention detection model; the attention detection model is based on an attention mechanism and is obtained by supervised learning of training images using gaze and head posture.
[0085] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the attention detection method provided by the above methods, the method comprising: acquiring a series of consecutive driver images; inputting the consecutive series of driver images into an attention detection model to obtain an attention detection result output by the attention detection model; the attention detection model is based on an attention mechanism and is obtained by supervised learning of training images using gaze and head posture.
[0086] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0087] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An attention detection method, characterized in that, include: Acquire consecutive multi-frame images of the driver; The continuous multi-frame driver images are input into the attention detection model to obtain the attention detection result output by the attention detection model; The attention detection model is based on the attention mechanism and is obtained by supervised learning of training images using gaze and head posture. The attention detection model includes: The feature extraction layer extracts features from the driver image to obtain a feature map; An attention detection layer performs attention detection on the feature map to obtain attention detection results, gaze features, and head posture features; Attention detection is performed on the feature map to obtain attention detection results, gaze features, and head pose features, including: Based on the attention mechanism and the feature map, gaze features and head pose features are obtained; An attention score is obtained based on the gaze characteristics and head posture characteristics; The attention score is mapped to a probability value, and the attention detection result is obtained based on the maximum probability value; Training the attention detection model includes: Acquire training images within the target time period and the ground truth values of attention, gaze, and head pose corresponding to the training images; The training images are used as input data for training, and the attention detection model to be trained is supervised by combining the ground truth of attention, the ground truth of gaze and the ground truth of head pose, so as to obtain the trained attention detection model.
2. The attention detection method according to claim 1, characterized in that, The completed attention detection model includes: The training image is input into the attention detection model to be trained to obtain the attention prediction result, gaze prediction result and head pose prediction result output by the attention detection model to be trained. Based on the attention prediction result and the attention ground truth, a first loss function is constructed; Based on the gaze prediction results and the gaze ground truth, a second loss function is constructed; Based on the head pose prediction results and the true head pose values, a third loss function is constructed. Based on the first loss function, the second loss function, and the third loss function, the total loss function is obtained, and the training ends when the total loss function converges, resulting in a trained attention detection model.
3. The attention detection method according to claim 1, characterized in that, The attention detection model to be trained includes: a feature extraction layer, which extracts features from the training image to obtain target features; An attention detection layer performs attention detection on the target features to obtain attention prediction results, gaze prediction features, and head pose prediction features. The target detection layer obtains the gaze prediction result and the head pose prediction result based on the gaze prediction feature and the head pose prediction feature.
4. The attention detection method according to claim 1, characterized in that, After obtaining the attention detection result output by the attention detection model, the process also includes: The attention detection results are sent to the vehicle terminal so that the vehicle terminal can perform corresponding measures based on the attention detection results.
5. An attention detection device, characterized in that, include: The data acquisition module acquires multiple consecutive frames of driver images; The attention detection module inputs the continuous multi-frame driver images into the attention detection model to obtain the attention detection result output by the attention detection model; The attention detection model is based on the attention mechanism and is obtained by supervised learning of training images using gaze and head posture. The attention detection model includes: The feature extraction layer extracts features from the driver image to obtain a feature map; An attention detection layer performs attention detection on the feature map to obtain attention detection results, gaze features, and head posture features; The attention detection layer is used for: Based on the attention mechanism and the feature map, gaze features and head pose features are obtained; An attention score is obtained based on the gaze characteristics and head posture characteristics; The attention score is mapped to a probability value, and the attention detection result is obtained based on the maximum probability value; The device further includes: The training module trains the attention detection model before the data input unit inputs multiple consecutive frames of driver images to the attention detection model unit; The training module includes: The data acquisition unit acquires training images within the target time period and the ground truth values of attention, gaze, and head posture corresponding to the training images. The training unit uses the training images as input data for training and combines the ground truth values of attention, gaze, and head pose to perform supervised training on the attention detection model to be trained, thereby obtaining the trained attention detection model.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the attention detection method as described in any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the attention detection method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Attention detection method and device, electronic equipment and storage medium
CN111680546A
Driver attention monitoring method and device and electronic equipment
CN111709264A
