Fatigue feedback method, device and system based on machine vision and medium
Using machine vision technology for video preprocessing, face and posture detection, and combined with machine learning models, the accuracy and reliability of traditional fatigue detection methods are solved, enabling accurate monitoring of workers’ fatigue status and personalized rest time recommendations. , improving work efficiency and safety.
Patent Information
- Application Number
- CN202410836379.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-24
AI Technical Summary
Traditional fatigue detection methods rely on subjective feelings and qualitative judgments, have limited accuracy and reliability, and are unable to effectively monitor and warn workers of their fatigue status, affecting work efficiency and safety.
Using a fatigue detection method based on machine vision, through video preprocessing, face recognition, posture detection and activity detection, combined with the trained machine learning model, fatigue detection results are generated, and rest time is personalized and recommended based on the detection results to improve detection accuracy performance and reliability.
It achieves accurate monitoring and analysis of workers' fatigue status, provides personalized rest time suggestions, improves work efficiency and safety, and reduces accidents caused by fatigue.
Smart Images

Figure CN118692128A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fatigue detection, and in particular to a fatigue feedback method, device, system and medium based on machine vision. Background Art
[0002] In modern society, many industries and jobs require workers to stay alert and highly focused for long periods of time, such as drivers, operators, and monitoring personnel. Long hours of work may cause fatigue in workers, which in turn affects work efficiency, increases the risk of work accidents, and has adverse effects on workers' physical and mental health. Traditionally, the detection of fatigue status mainly relies on subjective feelings and qualitative judgments, which are easily affected by individual subjective factors and the environment, and have limited accuracy and reliability.
[0003] Traditional fatigue feedback methods are highly subjective, the accuracy of fatigue detection results is limited, and existing technologies can only obtain the fatigue status of the person being tested. Summary of the invention
[0004] In order to solve one of the above problems, the purpose of the present invention is to provide a fatigue feedback method, device, system and medium based on machine vision, which can improve the accuracy and reliability of fatigue detection and can recommend rest time in a personalized way.
[0005] In one aspect, the present invention provides a fatigue feedback method based on machine vision, comprising the following steps:
[0006] Acquire a first video of the person to be detected, and preprocess the first video to obtain a video image and a second video; the preprocessing includes at least one processing process of denoising, image enhancement, image segmentation or image correction;
[0007] Performing face recognition on the video image to obtain a face image of the person to be detected, performing posture detection on the second video to obtain posture key point information of the person to be detected, and performing activity detection on the video image to obtain an activity area of the person to be detected;
[0008] Using the trained machine learning model to identify the face image, the posture key point information and the activity area, and generate a fatigue detection result;
[0009] The rest time is determined according to the fatigue detection result, and the fatigue detection result and the rest time are returned to the terminal.
[0010] Optionally, performing face recognition on the video image to obtain a face image of the person to be detected specifically includes:
[0011] Using a sliding window to identify the video image to obtain a Haar feature, and using a cascade classifier to process the Haar feature to obtain at least one detection frame;
[0012] Non-maximum suppression is performed on at least one detection frame to obtain the face image of the person to be detected.
[0013] Optionally, performing activity detection on the video image to obtain an activity area of the person to be detected specifically includes:
[0014] Tracking each pixel point of the video image to obtain an optical flow vector;
[0015] The activity area is obtained according to the optical flow vector and a preset threshold.
[0016] Optionally, the fatigue detection result includes fatigue degree, fatigue state and fatigue duration, and determining the rest time according to the fatigue detection result specifically includes:
[0017] generating a fatigue value according to the fatigue degree, the fatigue state and the fatigue duration;
[0018] A linear regression model is used to analyze the variation trend of the fatigue value, and the rest time is determined according to the fatigue value and the variation trend.
[0019] Optionally, the feedback method further includes:
[0020] Obtain personalized information and rest time threshold of the person to be tested;
[0021] Analyzing the environment and the tasks performed by the person to be detected according to the second video, and modifying the rest time according to the environment, the tasks performed and the personalized information of the person to be detected;
[0022] When the rest time is greater than or equal to the rest time threshold, an alarm is triggered.
[0023] Optionally, the trained machine learning model is trained by the following method:
[0024] Acquire a feature set; the feature set includes a face sample image, posture key point sample information and an activity sample area;
[0025] Calculate the correlation coefficient between each feature in the feature set and the fatigue detection result, collect the features with correlation coefficients greater than a preset value to obtain a highly correlated feature matrix, and obtain a data set according to the highly correlated feature matrix;
[0026] The data set is used to train an initial machine learning model to obtain the trained machine learning model.
[0027] Optionally, obtaining a data set according to the highly correlated feature matrix specifically includes:
[0028] Standardizing the highly correlated feature matrix, calculating the covariance matrix of the standardized highly correlated feature matrix, and performing eigenvalue decomposition on the covariance matrix to obtain eigenvalues of the covariance matrix and eigenvectors corresponding to the eigenvalues;
[0029] According to the eigenvalues of the covariance matrix, the principal component eigenvectors are determined from the eigenvectors corresponding to the eigenvalues to obtain the data set; the data set includes the principal component vectors.
[0030] On the other hand, the present invention provides a fatigue detection device based on machine vision, comprising:
[0031] at least one processor;
[0032] at least one memory for storing at least one program;
[0033] When the at least one program is executed by the at least one processor, the at least one processor implements the method described above.
[0034] In another aspect, the present invention provides a computer-readable storage medium storing a program executable by a processor. When the program executable by the processor is executed by the processor, it is used to perform the method as described above.
[0035] On the other hand, the present invention provides a fatigue feedback system based on machine vision, comprising a video acquisition device, a terminal and a computer device connected to the video acquisition device; wherein:
[0036] The video acquisition device is used to acquire a first video of the person to be detected, and upload the first video of the person to be detected to the computer device;
[0037] The computer device comprises:
[0038] at least one processor;
[0039] at least one memory for storing at least one program;
[0040] When the at least one program is executed by the at least one processor, the at least one processor implements the method described above;
[0041] The terminal is used to display fatigue detection results and rest time.
[0042] Implementation of the present invention includes the following beneficial effects: the present invention obtains a first video of the person to be detected, pre-processes the first video to obtain a video image and a second video, the pre-processing includes denoising, image enhancement, image segmentation or image correction, performs face recognition on the video image to obtain a face image of the person to be detected, performs posture detection on the second video to obtain posture key point information of the person to be detected, performs activity detection on the video image to obtain the activity area of the person to be detected, combines face detection, posture detection and activity detection in multiple ways, realizes monitoring and analysis of the fatigue state of the worker, and can more accurately and reliably judge whether the person to be detected is in a fatigue state; by using a trained machine learning model to identify the face image, posture key point information and activity area, generates a fatigue detection result, determines the rest time according to the fatigue detection result, and returns the fatigue detection result and the rest time to the terminal. In addition to the fatigue detection result, the present invention also calculates the rest time according to the detection result, and returns the fatigue detection result and the rest time to the terminal, so that the person to be detected can understand the fatigue state in time and rest according to the rest time. This rest suggestion can better meet the needs of the person to be detected for rest time. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flow chart of the steps of a fatigue feedback method based on machine vision provided by the present invention;
[0044] Figure 2 It is a flow chart of steps for detecting a face image provided by the present invention;
[0045] Figure 3 It is a flow chart of steps for detecting an activity area provided by the present invention;
[0046] Figure 4 It is a flowchart of the steps of training a machine learning model provided by the present invention;
[0047] Figure 5 It is a flow chart of steps for obtaining a data set according to a highly correlated feature matrix provided by the present invention;
[0048] Figure 6 It is a flow chart of steps for determining the rest time provided by the present invention;
[0049] Figure 7 It is a flow chart of steps for correcting the rest time provided by the present invention;
[0050] Figure 8 It is a structural schematic diagram of a fatigue feedback system based on machine vision provided by the present invention;
[0051] Fig. 9 It is a structural schematic diagram of another fatigue feedback system based on machine vision provided by the present invention;
[0052] Fig.10 This is a schematic diagram of the implementation environment of a fatigue feedback method based on machine vision provided by the present invention.
[0053] Fig.11 It is a structural schematic diagram of a fatigue detection device based on machine vision provided by the present invention. DETAILED DESCRIPTION
[0054] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The step numbers in the following embodiments are only provided for the convenience of explanation and description, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0055] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the embodiments of the present application. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0056] When the following description relates to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims. In the description of the present application, it is necessary to understand that the terms "first / S100", "second / S200", "third / S300", etc. are only used to distinguish similar objects, and do not have to be used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.
[0057] It is understandable that the fatigue feedback method based on machine vision provided by the present invention can be applied to any computer device with data processing and computing capabilities, and this computer device can be various terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this.
[0058] like Figure 1 As shown, Figure 1 The present invention is a flowchart of a fatigue feedback method based on machine vision. The present invention provides a fatigue feedback method based on machine vision, comprising the following steps:
[0059] S100: Obtain a first video of a person to be detected, and pre-process the first video to obtain a video image and a second video.
[0060] The preprocessing includes at least one of denoising, image enhancement, image segmentation or image correction.
[0061] The first video is a video of the person to be detected in a working scene, and the viewing angle in the first video can cover the activity area of the person to be detected.
[0062] Specifically, by performing statistical analysis on the pixel values of the static area of each frame image in the first video, the mean and standard deviation of the pixel values are calculated, and the intensity and distribution of the background noise in each frame image are estimated. If there is noise caused by motion blur in the first video, the intensity and influence range of the motion noise are estimated by analyzing the motion trajectory of the target object in the first video or the characteristics of motion blur, and the speed and direction of the motion need to be estimated.
[0063] Perform frequency domain analysis on each frame of the first video, calculate the power spectrum of the noise in the frequency domain, and obtain the frequency distribution of the noise; use a mean filter to average the pixels in the image; use a median filter to replace the value of the central pixel with the median of the pixels in the image, which is suitable for salt and pepper noise; use a Gaussian function to smooth the image and eliminate Gaussian noise; filter each frame of the video to further eliminate noise, and use a sliding window to gradually filter the entire video sequence to obtain the second video.
[0064] Perform image enhancement, image segmentation or image correction on each frame of the second video to obtain a video image. The image enhancement method includes but is not limited to histogram equalization, contrast enhancement, sharpening and the like. It is helpful to extract the target of interest, such as the face and body of the worker. Correct the segmented image to ensure that the object or area in the image is in a suitable position and angle, which is helpful to accurately extract features and perform subsequent steps such as face detection and posture detection.
[0065] S200, performing face recognition on the video image to obtain a face image of the person to be detected, performing posture detection on the second video to obtain posture key point information of the person to be detected, and performing activity detection on the video image to obtain an activity area of the person to be detected.
[0066] The facial image includes but is not limited to the facial position, expression and facial features, and the facial features include but are not limited to eyes, mouth and the like.
[0067] Key points include but are not limited to key parts such as the head, arms, and torso.
[0068] Models for face recognition include, but are not limited to, deep hidden IDentity features (DeepID) models and Haar cascade classifiers.
[0069] Models for posture detection include but are not limited to DensePose model, OpenPose model and AlphaPose model.
[0070] The algorithms for activity detection include but are not limited to optical flow methods, the activity area includes but is not limited to movement trajectory, movement speed and movement action, and the movement action includes but is not limited to walking, turning and other actions, which helps to determine whether the worker is in a state of fatigue.
[0071] The posture key point information includes but is not limited to the posture key point coordinates, key point visualization images and the relationship between key points, body posture and action. Body posture includes but is not limited to standing and sitting.
[0072] Specifically, the present invention provides a method for performing face recognition on a video image using a Haar cascade classifier to obtain a face image of a person to be detected, performing posture detection using OpenPose to obtain posture key point information of the person to be detected, and performing activity detection on a video image using an optical flow method to obtain an activity area of the person to be detected.
[0073] S300, using the trained machine learning model to identify facial images, posture key point information and activity areas, and generate fatigue detection results.
[0074] The trained machine learning model may be, but is not limited to, a random forest model.
[0075] The fatigue detection results include but are not limited to fatigue degree, fatigue state and fatigue duration. The fatigue state may include fatigue and non-fatigue.
[0076] Specifically, the face image, posture key point information and activity area are projected into the selected principal component space, and the projection result is input into the trained machine learning model. The trained machine learning model analyzes and recognizes the projected face image, posture key point information and activity area to generate fatigue detection results.
[0077] S400: Determine the rest time according to the fatigue detection result, and return the fatigue detection result and the rest time to the terminal.
[0078] The fatigue detection results and the rest time are returned to the terminal in the form of, but not limited to, charts, tables, etc., so that the user can intuitively understand the fatigue status of the worker.
[0079] The terminal may be, but is not limited to, a computer, a laptop, a tablet, a mobile phone or other electronic device with a display screen.
[0080] Specifically, the fatigue status returned is used to determine whether the person to be tested is fatigued. If the person to be tested is fatigued, an alarm is triggered to remind relevant personnel. The fatigue level, fatigue status and fatigue duration are comprehensively considered to generate a fatigue value, and the rest time is calculated based on the fatigue value.
[0081] The fatigue detection results and the rest time are presented to the person being detected or other relevant personnel in the form of a graphical interface.
[0082] In some embodiments, Figure 2 As shown, Figure 2 The present invention is a flowchart of steps for detecting a face image. Step S200 performs face recognition on a video image to obtain a face image of a person to be detected, specifically including:
[0083] S210 , using a sliding window to recognize the video image to obtain Haar features, and using a cascade classifier to process the Haar features to obtain at least one detection frame.
[0084] The cascade classifier includes at least one stage, and each stage includes at least one weak classifier.
[0085] Specifically, a sliding window is used to identify the video image to obtain Haar features, and the Haar features are input into each weak classifier in each stage step by step. The recognition frame that meets the judgment conditions of all stages of the cascade classifier is used as the detection frame, and the detection frame includes the area of the face.
[0086] The cascade classifier is trained by:
[0087] S211, create a training data set including positive and negative images, where the positive images include face images and the negative images include non-face images. The positive images include several face images with different postures, lighting conditions and expressions, and the negative images are any images that do not contain faces, and several means at least one.
[0088] S212, detecting Haar sample features (which may be Haar features or Haar-like features) in the training data level, wherein Haar-like features include line features, edge features, point features, and diagonal features. In this embodiment, Haar-like features are based on the sum of pixels of rectangular areas of different positions, sizes, and proportions in the video image, including black and white rectangular area features, and are used to represent the face area in the video image.
[0089] S213, inputting the Haar sample features into the cascade classifier for several iterative trainings.
[0090] S214. In each round of training, the Adaboost algorithm is used to select the Haar-like features with the best distinguishing ability to continuously improve the accuracy of the classifier. An optimal weak classifier can be selected in each iteration, and a strong classifier is constructed based on the optimal weak classifier. The strong classifiers are cascaded to obtain a cascade classifier that can complete the recognition task.
[0091] S220, performing non-maximum suppression on at least one detection frame to obtain a face image of the person to be detected.
[0092] Specifically, non-maximum suppression is performed on the detected detection frames to eliminate overlapping detection frames and retain the most likely face position to obtain a face image of the person to be detected.
[0093] Through steps S210-S220, the cascade classifier uses Haar-like features, which can quickly identify information such as edges, corners and textures in the image, thereby achieving efficient feature selection and reducing computational complexity. The cascade classifier adopts a cascade structure, and gradually screens out areas that are not faces in a cascade manner, so that the face area can be quickly located and the detection speed is improved. The cascade classifier has a high detection accuracy and a low false detection rate, and can perform effective target detection in complex backgrounds. The training process of the cascade classifier is relatively simple. It only needs to provide positive and negative samples for training and adjust some parameters to obtain a better classifier model.
[0094] In addition, the AdaBoost algorithm has strong adaptability and can effectively learn and classify in different data sets and scenarios. AdaBoost combines each weak classifier in a weighted manner, which can reduce the risk of overfitting and improve generalization ability. AdaBoost can combine multiple weak classifiers into a strong classifier, which can achieve higher classification accuracy and lower error rate.
[0095] In some embodiments, step S200 performs posture detection on the second video to obtain posture key point information of the person to be detected, specifically including:
[0096] S230 , inputting the second video for posture detection into OpenPose for processing.
[0097] S240. Use the installed OpenPose library to run the pose detection program, adjust the size of the input image, and set the preset confidence threshold for filtering the detected key points; determine the format of the control output results, and select the output key point coordinates, key point visualization images, and the relationship between key points.
[0098] S250, OpenPose returns the key point information of the posture of the person to be detected.
[0099] In some embodiments, Figure 3 As shown, Figure 3 The present invention is a flowchart of steps for detecting an activity area. Step S200 performs activity detection on a video image to obtain an activity area of a person to be detected, specifically including:
[0100] S260: Track each pixel of the video image to obtain an optical flow vector.
[0101] The optical flow vector represents the displacement of the pixel in time and is used to reflect the movement of the pixel.
[0102] Specifically, it is assumed that the grayscale values of pixels between adjacent frames of video images remain unchanged during the motion of the subject. Based on this assumption, the speed and direction of the subject's motion are estimated by calculating the grayscale changes between pixels of adjacent frames of video images.
[0103] In the process of tracking pixels, Lucas-Kanade optical flow can be used. Within a local window, assuming that the pixel grayscale values between adjacent frames remain unchanged, the pixels in adjacent video frames are tracked, and the motion of the pixels is estimated by minimizing the error to obtain the optical flow vector.
[0104] The calculation speed can be improved by applying the Lucas-Kanade optical flow algorithm. The Lucas-Kanade optical flow method uses the local characteristics of the image area and only needs to process local pixels. The Lucas-Kanade optical flow algorithm can effectively track the movement of corner points or sparse feature points on the edge of a moving object. The Lucas-Kanade optical flow algorithm can provide a high optical flow estimation accuracy. Especially when the motion is relatively small and the time interval between adjacent frame images is short, its accuracy is often relatively high.
[0105] S270: Obtain an activity area according to the optical flow vector and a preset threshold.
[0106] Specifically, a preset threshold is set, and the preset threshold is used to determine the motion intensity of the pixel points, analyze the optical flow vector, detect the activity of the pixel points in the video image, and thus identify the activity area in the image.
[0107] In some embodiments, the recognition result of the optical flow vector can also be visualized on the video image to display the movement direction and speed of each pixel in the video image.
[0108] In some embodiments, Figure 4 As shown, Figure 4 The flowchart is a step flow chart of training a machine learning model. The machine learning model trained in step S300 is obtained by the following method:
[0109] S310: Obtain a feature set.
[0110] The feature set includes but is not limited to face sample images, posture key point sample information and activity sample areas, and may also include other features that have low correlation with fatigue status result generation, and fatigue status labels corresponding to these features; the fatigue status label is used to identify the fatigue status of the worker, and the fatigue status includes fatigue and non-fatigue.
[0111] S320, calculating the correlation coefficient between each feature in the feature set and the fatigue detection result, collecting the features whose correlation coefficients are greater than a preset value to obtain a highly correlated feature matrix, and obtaining a data set based on the highly correlated feature matrix.
[0112] Specifically, the correlation coefficient may be, but is not limited to, a Pearson coefficient or a cosine similarity. The present invention provides a method for calculating the Pearson coefficient, as shown in formula (1):
[0113]
[0114] Among them, x i is the eigenvalue of the i-th sample, is the mean of the eigenvalues, y i is the fatigue state label of the i-th sample, is the mean of the fatigue status label, n is the number of samples, and r is the correlation coefficient between a feature and the fatigue detection result.
[0115] When r is close to 1, it means that there is a strong positive correlation between the feature and the fatigue state, and the increase in the feature value is linearly related to the increase in the fatigue state; when r is close to -1, it means that there is a strong negative correlation between the feature and the fatigue state, and the increase in the feature value is linearly related to the decrease in the fatigue state; when r is close to 0, it means that there is no linear correlation between the feature and the fatigue state.
[0116] Compare the correlation coefficients of all features, and select features with correlation coefficients greater than a preset value to form a highly correlated feature matrix. For example, based on the calculated Pearson coefficient, select features that are highly correlated with fatigue status and organize them into an m*n highly correlated feature matrix, where m is the number of features that are highly correlated with fatigue status, and n is the number of samples.
[0117] like Figure 5 As shown, Figure 5 It is a flowchart of the steps of obtaining a data set according to a highly correlated feature matrix. The steps of obtaining a data set according to a highly correlated feature matrix specifically include the following steps:
[0118] S321, standardize the highly correlated feature matrix, calculate the covariance matrix of the standardized highly correlated feature matrix, perform eigenvalue decomposition on the covariance matrix to obtain the eigenvalues of the covariance matrix and the eigenvectors corresponding to the eigenvalues.
[0119] Among them, the covariance matrix is used to reflect the linear relationship between highly correlated features.
[0120] Specifically, the highly correlated feature matrix is standardized, and each feature is converted to a scale, for example, the feature is scaled to a standard normal distribution with a mean of 0 and a variance of 1 to obtain standardized highly correlated features.
[0121] Calculate the covariance matrix of the standardized highly correlated feature matrix, perform eigenvalue decomposition on the covariance matrix, and obtain the eigenvalues of the covariance matrix and the eigenvectors corresponding to each eigenvalue. The eigenvalues are used to represent the variance of the sample data, and the eigenvectors are used to represent the direction of the highly correlated features.
[0122] S322. Determine the principal component eigenvectors from the eigenvectors corresponding to the eigenvalues of the covariance matrix to obtain a data set.
[0123] The data set includes, but is not limited to, principal component eigenvectors, labels, and features corresponding to the principal component eigenvectors.
[0124] Specifically, according to the size of the eigenvalue, the most important k eigenvectors are selected. These k eigenvectors are the principal component eigenvectors, which are the most important k principal components in the sample. The principal component corresponding to the eigenvector with a larger eigenvalue contains more information.
[0125] The highly correlated feature matrix is projected into the space of the principal component feature vectors to obtain a data set, that is, an m*k feature matrix. Through steps S321-S322, the highly correlated feature matrix is projected into a low-dimensional subspace composed of the selected principal components to select more representative samples.
[0126] S330. Use the data set to train an initial machine learning model to obtain a trained machine learning model.
[0127] Specifically, the data set was divided into a training set and a test set using a cross-validation partitioning method. The training set was input into the random forest model by constructing several random forest models of decision trees, and the random forest model was trained. The trained random forest model was evaluated using the test set, and the performance of the random forest model in the fatigue status result prediction task was evaluated using evaluation indicators, including accuracy, precision, recall, and F1-score. According to the evaluation indicators, the hyperparameters of the random forest model were tuned using grid search to obtain a trained machine learning model.
[0128] In some embodiments, Figure 6 As shown, Figure 6 The invention is a flowchart of steps for determining the rest time. Step S400 determines the rest time according to the fatigue detection result, specifically including:
[0129] S410: Generate a fatigue value according to the fatigue degree, fatigue state and fatigue duration.
[0130] Fatigue states include fatigue and non-fatigue.
[0131] Specifically, according to the result of fatigue detection, the non-fatigue state is represented as 0, the fatigue state is represented as a positive number, and the fatigue degree is evaluated as a score. The fatigue degree and the score are positively correlated. The more severe the fatigue degree is, the larger the score is. The score is used as a weight factor, and the positive number of the fatigue state is weighted according to the weight factor to obtain a weighted score. Considering the influence of the duration of the fatigue state on the fatigue value, the fatigue duration is converted into another score through the time decay function, and the score of the fatigue duration is weighted again to obtain the fatigue value. The fatigue state duration and the score are positively correlated. The longer the fatigue state of the person to be detected lasts, the fatigue value will increase accordingly, and vice versa.
[0132] S420: Analyze the variation trend of the fatigue value using a linear regression model, and determine the rest time according to the fatigue value and the variation trend.
[0133] Specifically, the fatigue value is converted into a specific quantitative index, and the fatigue values at multiple consecutive moments are converted into a continuous numerical range.
[0134] According to the generated continuous numerical range, the linear regression model is used to analyze the size and change trend of the fatigue value. If the fatigue value is greater than the preset value and shows an increasing trend, it indicates that the fatigue level of the person to be tested is high and is gradually increasing, so the rest time can be increased. If the fatigue value is greater than the preset value and shows a downward trend, the rest time can be reduced.
[0135] In some embodiments, Figure 7 As shown, Figure 7 The method is a flow chart of steps for correcting the rest time. The feedback method further includes S500 providing the corrected rest time and triggering an alarm according to the corrected rest time, specifically including:
[0136] S510: Obtain personalized information and rest time threshold of the person to be detected.
[0137] The personalized information includes but is not limited to the age, health condition and work experience input by the user or the person to be tested. The rest time threshold can be a preset threshold for rest time manually set by the user according to actual conditions. When the user does not set it, the preset threshold can be a default value.
[0138] S520, analyzing the environment and the tasks performed by the person to be detected based on the second video, and modifying the rest time according to the environment, the tasks performed and the personalized information of the person to be detected.
[0139] The second video can be used to analyze the environment and tasks of the person to be tested. Different working environments and tasks have different effects on rest needs. The rest time can be modified according to the working environment, specific work tasks, and personalized information of the person to be tested. If the physical conditions, noise level, and atmosphere of the working environment meet the preset conditions, the rest time can be increased. For tasks that require long-term concentration, high alertness, or repetitive tasks, the rest time and rest frequency can be adjusted.
[0140] It should be noted that, in some embodiments, the rest time returned to the terminal may be the rest time before correction, or the rest time after correction, or both, with the corrected rest time being used as a suggested time.
[0141] S530: When the rest time is greater than or equal to the rest time threshold, an alarm is triggered.
[0142] Specifically, when the rest time reaches a preset threshold, the system triggers an alarm to remind the person to be tested to take a rest.
[0143] For example, the current fatigue value is 75, which shows an upward trend, indicating that the worker's fatigue level is high and is gradually increasing. The administrator sets the preset value and rules of the fatigue value based on the actual situation: when the fatigue value exceeds 70, it is recommended that the worker rest for 10 minutes. When the fatigue value exceeds 80, it is recommended that the worker rest for 20 minutes. According to the individual differences of the workers, the system can personalize the recommendation of rest time based on factors such as age, health status, and work experience. For example, for young and energetic workers, the rest time can be reduced; for older or unwell workers, it is recommended to increase the rest time.
[0144] Through steps S410-S420 and S510-S520, the present invention considers multiple factors when calculating the rest time, including the size and change trend of the fatigue value, the working environment, the work tasks, etc. Consider factors such as the physical conditions of the working environment, the noise level, and the atmosphere of the workplace. A harsh working environment may accelerate the fatigue of workers and require increased rest time. Analyze the nature, requirements, and work intensity of the work tasks. For tasks that require long-term concentration, high alertness, or repetitiveness, more frequent rest is required. An interface for manually adjusting parameters is also provided for administrators, allowing administrators to manually set preset thresholds and rules for rest time according to actual conditions, so that the rest time obtained can adapt to different working environments and individual differences. The rules can be conditions for setting and correcting the rest time. Considering individual differences among different workers, such as age, health status, work experience, and other factors, recommendations for rest time can be personalized.
[0145] The implementation of the present invention includes the following beneficial effects: the present invention combines multiple methods such as face detection, posture detection and activity detection to realize the monitoring and analysis of the fatigue state of workers, and can more accurately determine whether the person to be detected is in a fatigue state.
[0146] The present invention calculates the rest time and returns the fatigue detection result and the rest time to the terminal, so that the person to be detected can understand the fatigue state in time and rest according to the rest time. This rest suggestion can better meet the needs of the person to be detected for rest time.
[0147] The present invention adjusts the rest time in a personalized manner by considering the age, health status, work experience, work environment and tasks of the person to be tested, so that the rest time is more in line with the actual rest needs of each person to be tested. This personalized rest suggestion can better meet the needs of different workers and improve work efficiency and health level.
[0148] The present invention utilizes machine vision technology to monitor the fatigue status of workers in real time, and by displaying the results of fatigue detection, once fatigue status is detected, an alarm can be immediately triggered to remind relevant personnel, which helps to take timely measures to reduce the occurrence of accidents.
[0149] The present invention may be applied in special industries and jobs that require workers to remain alert and highly focused for a long time, such as drivers, operators, monitoring personnel, etc., using machine vision to achieve timely warnings and other scenarios of face detection, posture detection and activity detection.
[0150] like Figure 8 As shown in the figure, Figure 8The present invention is a structural diagram of a fatigue feedback system based on machine vision. In some embodiments, the present invention provides a fatigue feedback system based on machine vision, including a video acquisition device, a terminal, and a computer device connected to the video acquisition device; wherein,
[0151] The video acquisition device is used to acquire a first video of the person to be detected, and upload the first video of the person to be detected to the computer device;
[0152] The computer device comprises:
[0153] at least one processor;
[0154] at least one memory for storing at least one program;
[0155] When the at least one program is executed by the at least one processor, the at least one processor implements the method described above;
[0156] The terminal is used to display fatigue detection results and rest time.
[0157] Specifically, for video acquisition equipment, it is mainly realized through a camera, and it may specifically include at least one camera; and for computer equipment, it may be different types of electronic devices or servers, including but not limited to desktop computers, laptops, physical servers, a node server in the blockchain, etc., and terminals include but are not limited to desktop computers, laptops, tablets, mobile phones, and terminals and video acquisition equipment may be integrated or not.
[0158] The position and angle of the camera installation enable the camera's shooting range to cover the activity area of the person to be tested. The camera is fixed at an appropriate position in the work scene, such as a high place or a corner, to obtain the best field of view coverage. Use the camera to collect the first video of the worker in the work scene in real time. The first video can be saved in a conventional format. During the experiment, the worker performs various activities in the work scene, including working, resting, moving, etc. Ensure that the worker's activity range covers the camera's field of view.
[0159] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0160] like Fig. 9 As shown in the figure, Fig. 9It is a structural schematic diagram of another fatigue feedback system based on machine vision. The line segments in the figure represent the modules included in the fatigue feedback system based on machine vision, and the arrows represent the execution flow of the fatigue feedback method based on machine vision. The present invention also provides another fatigue feedback system based on machine vision, including a data acquisition module, a video preprocessing module, a feature extraction module, a fatigue state analysis module, a result display and alarm module and a fatigue value calculation module.
[0161] The data acquisition module is used to acquire the first video (original data) of the person to be detected (worker).
[0162] The video processing module is used to obtain a first video of the person to be detected from the data acquisition module, and preprocess the first video to obtain a video image and a second video; the preprocessing includes denoising, image enhancement, image segmentation or image correction.
[0163] The feature extraction module is used to perform face recognition on the video image to obtain the face image of the person to be detected, perform posture detection on the second video to obtain the posture key point information of the person to be detected, and perform activity detection on the video image to obtain the activity area of the person to be detected.
[0164] The fatigue value calculation module is used to use the trained machine learning model to identify facial images, posture key point information and activity areas to generate fatigue detection results; determine the rest time based on the fatigue detection results, and return the fatigue detection results and rest time to the terminal. It is also used to give a corrected rest time and trigger an alarm based on the corrected rest time.
[0165] The result display and alarm module is used to display the fatigue detection results and rest time returned to the terminal.
[0166] In some embodiments, the feature extraction module is specifically used to use a sliding window to identify the video image to obtain Haar features, use a cascade classifier to process the Haar features, and obtain at least one detection frame; remove overlapping detection frames to obtain a face image of the person to be detected. Track each pixel point of the video image to obtain an optical flow vector; analyze the optical flow vector according to the optical flow vector and a preset threshold to obtain an activity area. The specific process is the same as the aforementioned method embodiment and will not be repeated here.
[0167] In some embodiments, the fatigue value calculation module is specifically used to generate a fatigue value according to the fatigue degree, fatigue state and fatigue duration; use a linear regression model to analyze the change trend of the fatigue value, and determine the rest time according to the fatigue value and the change trend. The specific process is the same as the above method embodiment, and will not be repeated here.
[0168] In some embodiments, the fatigue value calculation module is further used to obtain personalized information and a rest time threshold of the person to be detected; analyze the environment and tasks performed by the person to be detected based on the second video, and modify the rest time based on the environment, tasks performed and personalized information of the person to be detected; when the rest time is greater than or equal to the rest time threshold, trigger an alarm. The specific process is the same as the aforementioned method embodiment, and will not be repeated here.
[0169] It is easy to understand that the data acquisition module, video preprocessing module, feature extraction module, fatigue state analysis module, result display and alarm module and fatigue value calculation module can be integrated into the same terminal, for example, a terminal that integrates a data acquisition module including a camera, a processor including a video preprocessing module, a feature extraction module, a fatigue state analysis module, a fatigue value calculation module and a display screen including a result display and alarm module; they can also be set separately, with each module connected by communication or wires, for example, a data acquisition module that is not integrated into the terminal and a computer device of the fatigue feedback system based on machine vision as described above, the computer device includes a video preprocessing module, a feature extraction module, a fatigue state analysis module, a fatigue value calculation module and a result display and alarm module.
[0170] In addition, it can also be a data acquisition module that is not integrated in the terminal, the video preprocessing module, feature extraction module, fatigue state analysis module, fatigue value calculation module are located in the server, and the result display and alarm module are located in the terminal system.
[0171] like Fig.10 As shown, Fig.10 The present invention is a schematic diagram of an implementation environment of a fatigue feedback method based on machine vision, and the implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected to a network wirelessly or wired to complete data transmission and exchange.
[0172] The explanation of server 101 is the same as that in the application scenario of the fatigue feedback method based on machine vision, and will not be repeated here. In addition, server 101 can also be a node server in a blockchain network. Among them, blockchain is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
[0173] The terminal 102 is integrated with a data acquisition module. The terminal 102 and the server 101 may be directly or indirectly connected via wired or wireless communication, which is not limited in this embodiment.
[0174] like Fig.11 As shown, Fig.11The present invention is a structural schematic diagram of a fatigue detection device based on machine vision. The present invention also provides a fatigue detection device based on machine vision, including:
[0175] at least one processor;
[0176] at least one memory for storing at least one program;
[0177] When the at least one program is executed by the at least one processor, the at least one processor implements the steps of the fatigue feedback method based on machine vision described in the above method embodiment.
[0178] Among them, the memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. The memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a remote memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0179] It can be seen that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0180] In addition, the embodiment of the present application also discloses a computer program product or a computer program, and the computer program product or the computer program is stored in a computer-readable storage medium. The processor of the computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device performs the above method. Similarly, the contents in the above method embodiment are all applicable to the storage medium embodiment, and the functions specifically implemented by the storage medium embodiment are the same as those in the above method embodiment, and the beneficial effects achieved are also the same as those achieved by the above method embodiment.
[0181] The present invention also provides a computer-readable storage medium, which stores a program executable by a processor. The program executable by the processor is used to implement the above method when executed by the processor.
[0182] It is understood that all or some steps and systems in the disclosed method above can be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0183] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0184] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A fatigue feedback method based on machine vision, characterized in that: The following steps are involved: Acquire a first video of the person to be detected, and preprocess the first video to obtain a video image and a second video; the preprocessing includes at least one processing process of denoising, image enhancement, image segmentation or image correction; Performing face recognition on the video image to obtain a face image of the person to be detected, performing posture detection on the second video to obtain posture key point information of the person to be detected, and performing activity detection on the video image to obtain an activity area of the person to be detected; Using the trained machine learning model to identify the face image, the posture key point information and the activity area, and generate a fatigue detection result; The rest time is determined according to the fatigue detection result, and the fatigue detection result and the rest time are returned to the terminal.
2. The feedback method according to claim 1, characterized in that: The performing face recognition on the video image to obtain the face image of the person to be detected specifically includes: Using a sliding window to identify the video image to obtain a Haar feature, and using a cascade classifier to process the Haar feature to obtain at least one detection frame; Non-maximum suppression is performed on at least one detection frame to obtain the face image of the person to be detected.
3. The feedback method according to claim 1, characterized in that: The performing activity detection on the video image to obtain the activity area of the person to be detected specifically includes: Tracking each pixel point of the video image to obtain an optical flow vector; The activity area is obtained according to the optical flow vector and a preset threshold.
4. The feedback method according to claim 1, characterized in that: The fatigue detection result includes fatigue degree, fatigue state and fatigue duration, and determining the rest time according to the fatigue detection result specifically includes: generating a fatigue value according to the fatigue degree, the fatigue state and the fatigue duration; A linear regression model is used to analyze the variation trend of the fatigue value, and the rest time is determined according to the fatigue value and the variation trend.
5. The feedback method according to any one of claims 1 to 4, characterized in that: The feedback method further comprises: Obtain personalized information and rest time threshold of the person to be tested; Analyzing the environment and the tasks performed by the person to be detected according to the second video, and modifying the rest time according to the environment, the tasks performed and the personalized information of the person to be detected; When the rest time is greater than or equal to the rest time threshold, an alarm is triggered.
6. The feedback method according to any one of claims 1 to 4, characterized in that: The trained machine learning model is trained by the following method: Acquire a feature set; the feature set includes a face sample image, posture key point sample information and an activity sample area; Calculate the correlation coefficient between each feature in the feature set and the fatigue detection result, collect the features with correlation coefficients greater than a preset value to obtain a highly correlated feature matrix, and obtain a data set according to the highly correlated feature matrix; The data set is used to train an initial machine learning model to obtain the trained machine learning model.
7. The feedback method according to claim 6, characterized in that: The obtaining of a data set according to the highly correlated feature matrix specifically includes: Standardizing the highly correlated feature matrix, calculating the covariance matrix of the standardized highly correlated feature matrix, performing eigenvalue decomposition on the covariance matrix, and obtaining eigenvalues of the covariance matrix and eigenvectors corresponding to the eigenvalues; According to the eigenvalues of the covariance matrix, the principal component eigenvectors are determined from the eigenvectors corresponding to the eigenvalues to obtain the data set, which includes the principal component vectors.
8. A fatigue detection device based on machine vision, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.
9. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to perform the method according to any one of claims 1 to 7 when executed by the processor.
10. A fatigue feedback system based on machine vision, characterized in that: It includes a video acquisition device, a terminal and a computer device connected to the video acquisition device; wherein, The video acquisition device is used to acquire a first video of the person to be detected, and upload the first video of the person to be detected to the computer device; The computer device comprises: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7; The terminal is used to display fatigue detection results and rest time.
Citation Information
Patent Citations
Fatigue detection method and related device
CN113657212A
Fatigue driving detection and identification method and device
CN114973213A
Chemical production line safety evaluation system
CN115600808A
Dielectric-based terahertz metalens manufacturing method using 3D printing and metalens manufactured thereby
KR1020250167177A
Fatigue driving detection method and apparatus, computer device, and storage medium
WO2020024395A1
Cited By
Expression recognition method and device based on time decay mechanism, equipment and medium
CN118942140A
Anesthesia postoperative pain assessment method in combination with facial expression of patient
CN120318892A
