A standard operation video key frame extraction method based on deep learning
By combining the VideoMamba model with SOP structured steps and equipment status data, standard operation video keyframes are generated, solving the problem that video frames are unrelated to operation steps in existing technologies and achieving accuracy and relevance of keyframes.
Patent Information
- Application Number
- CN202611066338.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-17
- Publication Date
- 2026-11-27
AI Technical Summary
Existing technologies fail to effectively combine SOP structured steps, finger-based calibration results, and equipment status data in the extraction of key frames from standard operating procedure (SOP) videos, resulting in selected video frames that may be irrelevant to the key steps of the SOP.
The VideoMamba model is adopted. The multi-source construction layer generates a multi-source token sequence and step boundary index for the job. Combined with the segmented scanning layer, a step boundary-aware temporal representation is generated. Risk scanning and state correction are performed in the risk scanning layer and the mutation correction layer. Finally, a set of standard job video keyframes is generated.
It achieves keyframe extraction with complete step coverage, accurate risk identification, and high image usability, ensuring that keyframes are closely related to standard operating procedures.
Smart Images

Figure CN123182089A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video keyframe extraction technology, and in particular to a standard operating procedure video keyframe extraction method based on deep learning. Background Technology
[0002] Currently, in the field of keyframe extraction from standard operating procedure (SOP) videos, existing technologies typically employ fixed-interval frame extraction, inter-frame differencing, visual saliency analysis, or general video summarization models to extract keyframes. However, these methods primarily rely on the degree of change in the image to make judgments, without incorporating SOP structured steps, finger-based calibration results, and equipment status data. Consequently, they may easily select video frames with significant image changes that are irrelevant to the key steps of the standard operating procedure. Summary of the Invention
[0003] One objective of this invention is to propose a method for extracting keyframes from standard operation videos based on deep learning. This invention uses the VideoMamba model to extract keyframes from standard operation videos, which has the advantages of complete step coverage, accurate risk identification, and high image availability.
[0004] A video keyframe extraction method incorporating self-supervised deep learning according to an embodiment of the present invention includes the following steps: S1. Collect standard operation videos and preprocess them, read the standard operation related data, and generate standard operation video records; S2. Based on standard operation video recordings, generate SOP structured step sequences, step calibration results, and frame-level device status characteristics; S3. Input the standard operation video recording, SOP structured step sequence, step calibration results and frame-level device status features into the multi-source construction layer of the VideoMamba model to generate a multi-source token sequence and step boundary index for the operation; S4. Input the step boundary index and the job multi-source token into the segmented scanning layer of the VideoMamba model to generate a step boundary-aware temporal representation; S5. Input the step boundary-aware temporal representation and frame-level device state features into the risk scanning layer of the VideoMamba model to generate a risk scanning state representation. S6. Input the frame-level device state features into the mutation correction layer of the VideoMamba model to generate a mutation-enhanced state representation; S7. The mutation-enhanced state representation, step boundary-aware temporal representation, risk scanning state representation, and frame-level device state features are used as inputs to the scoring correction layer of the VideoMamba model to perform state fusion and environmental degradation correction, generating a set of standard operation video keyframes.
[0005] Furthermore, S1 specifically includes: S11. Acquire standard operation video, which includes video stream and audio stream; extract video frame sequence arranged according to acquisition time from video stream; perform frame rate unification using linear frame interpolation, resolution unification using bilinear interpolation, brightness equalization using contrast-limited adaptive histogram equalization, and image stabilization processing using ORB feature matching on video frame sequence; perform noise reduction processing on audio stream using spectral subtraction; perform unified calibration based on display timestamp of video frame and sampling timestamp of audio sampling point to complete timestamp calibration of video frame sequence and audio stream, and obtain preprocessed video frame sequence and preprocessed audio data; S12. Read the standard operation association data, which comes from the MES, equipment management, and standard operation system, including the task identifier, equipment identifier, standard operation file identifier, task start time, task end time, and equipment status data source identifier; based on the task start time, task end time, and video frame sequence acquisition time, generate video frame timestamps corresponding to the preprocessed video frame sequence; using the video frame timestamps as a reference, employ a timestamp-based nearest neighbor matching algorithm to perform time correspondence processing on each video frame and the preprocessed audio data within the same time range, generating a time-corresponding video frame sequence. The audio data is time-corresponding; the corresponding video segment time range and audio segment time range are determined by the video frame timestamp; a correspondence is established between the video frame identifier and the audio segment identifier for video frame timestamps falling within the same 1-second time window; and the task identifier, video frame identifier, video segment time range, audio segment identifier, and audio segment time range are written into the same associated record to generate video-audio associated data; wherein, the video frame identifier is a unique identifier generated according to the arrangement order of the video frames in the time-corresponding video frame sequence, and the audio segment identifier is a unique identifier generated according to the segmentation order of the audio segments in the time-corresponding audio data; S13. Use the time-corresponding video frame sequence, time-corresponding audio data, video frame timestamps, standard operation association data, and video-audio association data as the data of the standard operation video recording data structure to generate a standard operation video record.
[0006] Furthermore, S2 specifically includes: S21. Read the standard operation associated data, call the corresponding standard operation file according to the standard operation file identifier, write the step number, step name, operation object, action requirements, safety matters and risk nodes in the standard operation file into the structured step table, and generate the SOP structured step sequence according to the step number. S22. Read the video and audio association data in the standard operation video recording, extract the corresponding audio segments according to the audio segment identifier and audio segment time range, perform feature extraction and speech-to-text processing on the audio segments to obtain the spoken segment text, extract the operation object words, action words and confirmation words from the spoken segment text, match the above words with the step name, operation object and action requirements in the SOP structured step sequence to obtain the step number corresponding to each video frame, and generate the step calibration result; S23. Read the equipment status data source identifier in the standard operation associated data, obtain the equipment status data corresponding to the standard operation video record, align the numerical status and switch status in the equipment status data to the corresponding video frame according to the video frame timestamp, and generate the frame-level equipment status feature corresponding to each video frame; wherein the numerical status includes temperature, pressure, current, voltage and gas detection value, and the switch status includes valve opening and closing status, equipment start and stop status, power failure status and tag confirmation status.
[0007] Furthermore, S3 specifically includes: S31. The multi-source construction layer of the VideoMamba model is based on the time-corresponding video frame sequence and video frame timestamp in the standard operation video recording. A YOLO object detection network is used to perform target region detection on each video frame, obtaining equipment region images, instrument region images, hand action region images, and tool region images. Convolutional feature extraction is performed on the above region images using a ResNet convolutional neural network with the classification output layer removed. After convolution processing and global average pooling, feature vectors for the equipment region, instrument region, hand action region, and tool region are obtained. These four types of feature vectors are sequentially concatenated to generate a frame-level image combination vector. An affine transformation is performed on the frame-level image combination vector using a fully connected layer linear projection function to obtain a fixed-dimensional frame visual token vector. The frame visual token vector corresponding to each video frame is arranged according to the video frame timestamp to generate a frame visual token sequence. The data structure of the frame visual token vector includes a video frame identifier, a video frame timestamp, and a frame visual feature vector. S32. Read each work step record in the SOP structured step sequence. The work step record includes step number, step name, operation object, action requirement, safety matter, and risk node. Use a dictionary-based maximum forward matching word segmentation algorithm to segment different work step records to obtain a set of word terms for step name, operation object, action requirement, safety matter, and risk node. Encode the word terms for each set and use a dot product attention mechanism to calculate the attention weight of each word vector. Sum the word vectors according to the attention weight to obtain the step name encoding vector, operation object encoding vector, action requirement encoding vector, safety matter encoding vector, and risk node encoding vector. Convert the step number into a step sequence encoding vector. Concatenate the above encoding vectors in order and perform an affine transformation to generate a step semantic token. Arrange the step semantic tokens corresponding to each work step according to the step number to generate a step semantic token sequence. S33. Based on the step calibration results, for any video frame, according to the step number corresponding to the video frame, search for a step semantic token with the same step number in the step semantic token sequence, and concatenate the frame visual feature vector in the frame visual token vector corresponding to the video frame with the found step semantic token to obtain a frame step concatenation vector; perform affine transformation and normalization processing on the frame step concatenation vector to generate the step alignment token vector corresponding to the video frame; arrange the step alignment token vectors corresponding to all video frames according to the video frame timestamp to generate a step alignment token sequence. S34. Read the frame-level device status features, normalize the device status values to obtain a numerical status vector, and binarize the device switch status to obtain a switch status vector; concatenate the numerical status vector and the switch status vector in a fixed order to generate a frame-level device status combination vector; perform linear mapping and normalization on the frame-level device status combination vector to generate a device status token vector; arrange the device status token vector corresponding to each video frame according to the video frame timestamp to generate a device status token sequence. S35. Using the video frame timestamp as the alignment reference, perform frame-matching on the step alignment token vector and the device status token vector corresponding to the same video frame timestamp. For any video frame, concatenate the step alignment token vector and the device status token vector corresponding to the video frame to generate a multi-source combined vector. Perform an affine transformation on the multi-source combined vector to obtain the job multi-source token vector. Arrange all job multi-source token vectors according to the video frame timestamp to generate a job multi-source token sequence. S36. Read the step number corresponding to each video frame in the step calibration result, and compare the step numbers of adjacent video frames frame by frame according to the video frame timestamp. When the step numbers of adjacent video frames are different, record the position of the next video frame as the start position of the new step, and record the position of the previous video frame as the end position of the previous operation step. Generate a step boundary index based on the start and end positions of each operation step.
[0008] Furthermore, S4 specifically includes: S41. Input the step boundary index and the multi-source token sequence of the job into the segmented scanning layer of the VideoMamba model; the segmented scanning layer of the VideoMamba model includes a subsequence partitioning unit, a bidirectional scanning unit, a gated transfer unit, and a timing representation output unit. S42. The subsequence partitioning unit reads the multi-source token sequence and step boundary index of the job, and divides the multi-source token vectors of the job that are located between the start and end positions of the same job step into the same step subsequence. S43. The bidirectional scanning unit performs bidirectional selective state space scanning on the multi-source token vector of the job in each step subsequence: it performs forward selective state space scanning along the increasing direction of the video frame timestamp to obtain the forward step scanning state, and performs reverse selective state space scanning along the decreasing direction of the video frame timestamp to obtain the reverse step scanning state; for the same token position in the same step subsequence, the forward step scanning state is used as the first half vector and the reverse step scanning state is used as the second half vector, and they are connected according to the feature dimension to generate a bidirectional state combination vector. The bidirectional state combination vector is linearly mapped to restore it to the same fixed dimension as the multi-source token vector of the job, and then normalized to generate the in-step scanning state; The specific steps for generating the forward step scan state include: reading the job multi-source token vector in the step sub-sequence according to the increasing direction of the video frame timestamp; when the current job multi-source token vector is the first token vector in the step sub-sequence, initializing the previous forward scan state and the forward retention coefficient to zero vectors, initializing the forward write coefficient to an all-one vector, and generating a forward candidate state vector based on the current job multi-source token vector; using the forward candidate state vector as the forward step scan state at the current token position; when the current job multi-source token vector is not the first token vector in the step sub-sequence, processing the current job multi-source token vector to generate the forward retention coefficient, the forward write coefficient, and the forward candidate state vector; multiplying the previous forward scan state and the forward retention coefficient element by element to obtain the retained historical state; multiplying the forward candidate state vector and the forward write coefficient element by element to obtain the current state after writing; and adding the retained historical state and the current state after writing element by element to obtain the forward step scan state at the current token position. The specific steps for generating positive retention coefficients include: reading the step name component, operation object component, action requirement component, safety matter component, visual action component, equipment numerical status component, and equipment on / off status component from the current job's multi-source token vector; reading the positive step scan status of the previous token position; calculating the cosine similarity between the step name component of the current token position and the step name component of the previous token position to obtain the step continuity evaluation value; calculating the cosine similarity between the operation object component of the current token position and the operation object component of the previous token position to obtain the object continuity evaluation value; calculating the difference between the equipment numerical status component of the current token position and the equipment numerical status component of the previous token position and taking the absolute value to obtain the equipment numerical change value; and calculating the difference between the equipment on / off status component of the current token position and the equipment on / off status component of the previous token position. The quantities are compared by XOR, and dimensions with the same state are marked as 0, while dimensions with different states are marked as 1, to obtain the device switching change quantity. The device numerical change quantity is normalized to obtain the device numerical change normalized quantity. The device switching change quantity is binarized to obtain the device switching change identifier. The step continuous evaluation quantity, object continuous evaluation quantity, device numerical change normalized quantity, and device switching change identifier are concatenated in sequence to obtain the retention combination vector. The device numerical change normalized quantity and device switching change identifier are subtracted by 1 to obtain the device numerical retention tendency quantity and the device switching retention tendency quantity. The step continuous evaluation quantity, object continuous evaluation quantity, device numerical retention tendency quantity, and device switching retention tendency quantity are concatenated in sequence to obtain the retention correction vector. The fully connected layer with the same input and output dimensions as the forward step scan state dimensions is subjected to affine mapping to generate the positive retention evaluation vector. The positive retention evaluation vector is normalized to obtain the positive retention coefficient. The specific steps for generating positive write coefficients include: reading the action requirement component, safety matter component, visual action component, device numerical status component, and device on / off status component from the multi-source token vector of the current job; calculating the difference between the action requirement component at the current token position and the action requirement component at the previous token position, specifically by calculating the cosine similarity between the action requirement component at the current token position and the action requirement component at the previous token position, and subtracting the cosine similarity from 1 to obtain the action change evaluation quantity; calculating the cosine similarity between the safety matter component at the current token position and the risk node component of the corresponding step in the SOP structured step sequence to obtain the safety matter hit evaluation quantity; calculating the difference between the visual action component at the current token position and the visual action component at the previous token position to obtain the visual action change quantity; calculating the difference between the device numerical status component at the current token position and the device numerical status component at the previous token position and taking the absolute value to obtain the device numerical change quantity; and comparing the state change of the device on / off status component at the current token position and the device on / off status component at the previous token position, specifically by comparing the state change of the current token... The device switch state component at the current location is XORed with the device switch state component at the previous token location. Dimensions with the same state are marked as 0, and dimensions with different states are marked as 1, resulting in the device switch change quantity. The action change evaluation quantity, safety event hit evaluation quantity, visual action change quantity, device value change quantity, and device switch change quantity are each converted into a write sub-vector of the same dimension. The write sub-vector corresponding to the action change evaluation quantity and the write sub-vector corresponding to the visual action change quantity are then subjected to a dimensional maximum-value process to obtain the action write response vector. The write sub-vector corresponding to the device value change quantity is then compared with the device switch change quantity. The corresponding write sub-vector is processed by taking the maximum value of each dimension to obtain the device write response vector; the write sub-vector corresponding to the safety event hit evaluation quantity is used as the safety write response vector; based on the keyframe annotation results of the training samples, the action write weight, safety write weight and device write weight are determined in the validation set with the condition of the maximum F1 value of keyframe recognition. The three types of write weights are used to weight the obtained action write response vector, safety write response vector and device write response vector respectively. The weighted results are added dimension by dimension to generate a positive write evaluation vector. The positive write evaluation vector is normalized to obtain the positive write coefficient. The specific steps for generating positive candidate state vectors include: scaling the step name component, operation object component, action requirement component, safety matter component, visual action component, equipment numerical state component, and equipment switch state component in the current job's multi-source token vector; specifically, firstly, performing an affine transformation to convert each component into an intermediate vector of the same dimension; then, using a layer normalization method to normalize the mean and variance of each intermediate vector to obtain unified components for step name, operation object, action requirement, safety matter, visual action, equipment numerical state, and equipment switch state; and sequentially concatenating these components to generate a candidate state combination vector; and then performing feature compression on the candidate state combination vector; specifically, performing linear projection dimensionality reduction on the candidate state combination vector through a fully connected layer with an output dimension smaller than the input dimension, compressing the candidate state combination vector to the same dimension as the positive step scan state, and then performing layer normalization on the dimensionality reduction result to obtain the positive candidate state vector. The specific steps for generating the reverse step scan state include: reading the current job multi-source token vector in the step sub-sequence according to the decreasing direction of the video frame timestamp, specifically including the step name component, operation object component, action requirement component, safety matter component, visual action component, device numerical status component, and device on / off status component; performing retention mapping, write mapping, and candidate state mapping on the above components respectively to generate reverse retention coefficient, reverse write coefficient, and reverse candidate state vector; multiplying the reverse step scan state of the next token position with the reverse retention coefficient element by element to obtain the historical state after reverse retention; multiplying the reverse candidate state vector with the reverse write coefficient element by element to obtain the current state after reverse write; and adding the historical state after reverse retention element by element with the current state after reverse write to obtain the reverse step scan state of the current token position. The specific steps for generating the reverse retention coefficients include: reading the current job multi-source token vector in the step sub-sequence according to the decreasing direction of the video frame timestamp, and reading the reverse step scan state at the next token position; calculating the cosine similarity between the step name component at the current token position and the step name component at the next token position to obtain the reverse step continuous evaluation value; calculating the cosine similarity between the operation object component at the current token position and the operation object component at the next token position to obtain the reverse object continuous evaluation value; calculating the difference between the device numerical state component at the current token position and the device numerical state component at the next token position and taking the absolute value to obtain the reverse device numerical change value; performing an XOR comparison between the device on / off state component at the current token position and the device on / off state component at the next token position, recording the dimension with the same state as 0 and the dimension with different states as 1 to obtain the reverse device on / off change value; normalizing the reverse device numerical change value to obtain the reverse device numerical change normalized value; and binarizing the reverse device on / off change value to obtain the reverse device on / off change identifier. Subtracting the reverse device numerical change normalization factor from 1 yields the reverse device numerical retention tendency factor. Subtracting the reverse device switch change flag from 1 yields the reverse device switch retention tendency factor. The reverse step continuous evaluation factor, reverse object continuous evaluation factor, reverse device numerical retention tendency factor, and reverse device switch retention tendency factor are concatenated sequentially to obtain the reverse retention correction vector. An affine transformation is performed on the fully connected layer whose input / output dimensions match the reverse step scan state dimension to generate the reverse retention evaluation vector. The reverse retention evaluation vector is then normalized to obtain the reverse retention coefficients. (The process is repeated three times in the original text.) The specific steps for generating reverse write coefficients include: following the method for generating forward write coefficients, calculating the difference between the action requirement component at the current token position and the action requirement component at the next token position to obtain a reverse action change evaluation quantity; calculating the cosine similarity between the security matter component at the current token position and the risk node of the corresponding step in the SOP structured step sequence to obtain a reverse security matter hit evaluation quantity; calculating the difference between the visual action component at the current token position and the visual action component at the next token position to obtain a reverse visual action change quantity; calculating the difference between the device numerical state component at the current token position and the corresponding component at the next token position and taking the absolute value as the reverse device numerical change quantity; performing an XOR comparison between the device on / off state component at the current token position and the device on / off state component at the next token position, recording dimensions with the same state as 0, and recording the state as... Different dimensions are denoted as 1 to obtain the reverse device switch change quantity; the reverse action change evaluation quantity, reverse security event hit evaluation quantity, reverse visual action change quantity, and reverse device state change quantity are converted into reverse write sub-vectors of the same dimension. The reverse write sub-vectors corresponding to the reverse action change evaluation quantity and the reverse write sub-vectors corresponding to the reverse visual action change quantity are subjected to dimension-wise maximum value processing to obtain the reverse action write response vector; the reverse write sub-vectors corresponding to the reverse device numerical change quantity are used as the reverse device numerical write response vectors, and the reverse write sub-vectors corresponding to the reverse device switch change quantity are used as the reverse device switch write response vectors; the reverse action write response vectors, the reverse write sub-vectors corresponding to the reverse security event hit evaluation quantity, the reverse device numerical write response vectors, and the reverse device switch write response vectors are weighted and accumulated to generate the reverse write evaluation vectors. The reverse write evaluation vectors are normalized to obtain the reverse write coefficients. The specific steps for generating the reverse candidate state vector include: according to the generation method of the forward candidate state vector, the step name component, operation object component, action requirement component, safety matter component, visual action component, equipment numerical state component and equipment switch state component in the current job multi-source token vector are scaled uniformly, and sequentially concatenated to generate the reverse candidate state combination vector. The reverse candidate state combination vector is then subjected to feature compression and normalization to obtain the reverse candidate state vector. The specific steps for generating the reverse scan state include: reading the current job multi-source token vector in the step sub-sequence according to the decreasing direction of the video frame timestamp; when the current job multi-source token vector is the last token vector in the step sub-sequence, initializing the reverse step scan state and reverse retention coefficient of the next token position to zero vectors, initializing the reverse write coefficient to an all-one vector, and generating a reverse candidate state vector based on the current job multi-source token vector; using the reverse candidate state vector as the reverse step scan state of the current token position; when the current job multi-source token vector is not the last token vector in the step sub-sequence, multiplying the reverse step scan state of the next token position with the reverse retention coefficient according to the corresponding dimension to obtain the reverse retention state; multiplying the reverse candidate state vector with the reverse write coefficient according to the corresponding dimension to obtain the reverse write state; and adding the reverse retention state and the reverse write state according to the corresponding dimension to obtain the reverse step scan state of the current token position. S44. Input the in-step scan state corresponding to the adjacent step sub-sequence into the gating transfer unit, read the in-step scan state corresponding to the end token of the previous SOP step and the starting token vector of the next SOP step. The in-step scan state corresponding to the end token of the previous SOP step is generated by retaining the safety matter state interval, equipment state interval, and action completion state interval according to the position of the state components. The gating transfer unit reads the preceding safety matter state component from the safety matter state interval, the preceding equipment state component from the equipment state interval, and the preceding action completion state component from the action completion state interval. The starting token vector of the next SOP step is composed of a fixed order of step name component, operation object component, action requirement component, safety matter component, visual action component, equipment numerical state component, and equipment switch state component. The gating transfer unit reads the subsequent operation object component from the operation object component position, the subsequent action requirement component from the action requirement component position, and the subsequent safety matter component from the safety matter component position. The preceding safety event status component is matched with the subsequent safety event component to generate a continuous safety event evaluation quantity. Specifically, the matching process involves calculating cosine similarity after same-dimensional mapping. The preceding device status component is matched with the subsequent operation object component to generate a continuous device object evaluation quantity. The preceding action completion status component is matched with the subsequent action requirement component to generate an action connection evaluation quantity. The continuous safety event evaluation quantity, the continuous device object evaluation quantity, and the action connection evaluation quantity are converted into same-dimensional sub-vectors and concatenated in the order of safety association, device association, and action association to generate a cross-step concatenation vector. The cross-step concatenation vector is then segmented, normalized, and weighted to obtain a cross-step association evaluation vector. The cross-step association evaluation vector is normalized again to generate step transmission weights. The step-by-step scan state corresponding to the end token of the previous SOP step is multiplied element-wise with the step transmission weights to obtain the cross-step transmission state. The cross-step transmission state is written into the step-by-step scan state corresponding to the start token of the next SOP step to generate a cross-step scan state. The specific steps for generating continuous safety event evaluation metrics, continuous equipment object evaluation metrics, and action connection evaluation metrics include: normalizing the preceding safety event state component and the subsequent safety event component into safety event vectors of the same dimension, calculating their cosine similarity to obtain a safety event semantic similarity value, multiplying the safety event semantic similarity value by a confirmation completion flag to obtain a continuous safety event evaluation metric, where the confirmation completion flag is a flag with a value of 0 or 1; reading the equipment identifier vector and equipment state change vector from the preceding equipment state component, reading the operation object vector from the subsequent operation object component, calculating the cosine similarity between the equipment identifier vector and the operation object vector to obtain an equipment object similarity value, and then calculating the continuous safety event evaluation metric based on the equipment state change... The state change amplitude in the vector is used to generate the effective value of the device state. The device object similarity value is multiplied by the effective value of the device state to obtain the continuous evaluation value of the device object. The preceding action type vector and action completion identifier are read from the preceding action completion state component, and the subsequent action type vector is read from the subsequent action requirement component. The cosine similarity of the action connection between the preceding action type vector and the subsequent action type vector is calculated. The step adjacency relationship between the previous SOP step and the next SOP step in the SOP structured step sequence is read. The cosine similarity of the action connection, the action completion identifier and the step adjacency relationship are multiplied to obtain the action connection evaluation value. The action completion identifier and the step adjacency relationship are both identifiers with values of 0 or 1. S45. The timing representation output unit fuses the in-step scan state and the cross-step scan state: the cross-step transmission state is written to the starting token position of the next SOP step, the starting token position and the current token position of the next SOP step are read, the token interval number between the current token position and the starting token position is calculated, the token interval number is added by 1 to obtain the interval adjustment value, the reciprocal of the interval adjustment value is used as the initial attenuation amount, the initial attenuation amount corresponding to all token positions in the next SOP step is normalized to obtain the transmission attenuation coefficient corresponding to each token position; the cross-step transmission state is multiplied element by element by the transmission attenuation coefficient to obtain the cross-step attenuation state transmitted to the current token position, the in-step scan state and the cross-step attenuation state of the current token position are weighted and summed to obtain the step boundary awareness timing vector of the current token position, and the step boundary awareness timing vectors of all token positions are arranged according to the video frame timestamp to generate the step boundary awareness timing representation.
[0009] Furthermore, S5 specifically includes: S51. Input the step boundary-aware timing representation and frame-level device state features into the risk scanning layer. The risk scanning layer includes a state change evaluation unit, a risk gating weight generation unit, a risk weighted scanning unit, and a scanning state output unit. S52. In the risk scanning layer, the state change evaluation unit reads the equipment numerical states corresponding to the current video frame and the previous video frame, performs difference calculations on the corresponding dimensions of temperature, pressure, current, voltage, and gas detection values, and takes the absolute value of the difference results to obtain the original change amount of each equipment numerical field. The unit performs maximum value normalization processing on each original change amount to obtain the equipment numerical change evaluation amount. The unit reads the equipment switch states corresponding to the current video frame and the previous video frame, performs XOR comparison on the corresponding dimensions of valve opening / closing state, equipment start / stop state, power failure state, and tag confirmation state. When the equipment switch state of the same dimension changes, the value of that dimension is 1; when the equipment switch state of the same dimension does not change, the value of that dimension is 0. The XOR comparison results of each dimension are arranged in the order of valve opening / closing state, equipment start / stop state, power failure state, and tag confirmation state to generate the equipment switch change evaluation vector. S53. Input the step boundary perception timing representation, equipment numerical change evaluation quantity, and equipment switch change evaluation quantity into the risk gating weight generation unit for risk gating fusion encoding processing: Read the risk node state component corresponding to the current video frame from the step boundary perception timing representation, where the risk node state component is used to represent the safety matters and risk nodes in the standard operation step to which the current video frame belongs; Segment and splice the risk node state component, equipment numerical change evaluation quantity, and equipment switch change evaluation quantity in the order of risk node, numerical change, and switch change to obtain the risk gating combination vector; Perform segmented normalization processing on the risk gating combination vector to make the risk node segment, numerical change segment, and switch change segment in the same value range; Then, use the Sigmoid function to perform interval compression processing on the segmented normalization result to obtain the risk gating weight with a value in the range of 0 to 1; S54. The risk-weighted scanning unit reads each time-series vector in the step boundary perception time-series representation according to the video frame timestamp order, reads the current time-series vector in the step boundary perception time-series representation according to the video frame timestamp order, multiplies the risk gating weight with the previous risk scanning state according to the corresponding dimension to obtain the risk retention state, multiplies the current time-series vector with the risk gating weight according to the corresponding dimension to obtain the risk writing state, and adds the risk retention state and the risk writing state according to the corresponding dimension to obtain the current risk scanning state corresponding to the current video frame. S55. In the scanning status output unit, the current risk scanning status corresponding to each video frame is bound to the corresponding video frame timestamp, and a risk scanning status representation is generated according to the video frame timestamps.
[0010] Specifically, S6 includes: S61. Input the frame-level device status features and risk scan status representation into the mutation correction layer; read the device numerical status corresponding to adjacent video frames, subtract the values of the current video frame from the previous video frame in each device numerical field and take the absolute value to obtain the original numerical mutation amount; normalize the original numerical mutation amount according to the allowable value range of each device numerical field to obtain the device numerical mutation evaluation vector; read the device switch status corresponding to adjacent video frames, XOR the status of the current video frame from the previous video frame in each device switch field, and when the status of the same field changes, the field takes the value of 1, and when the status of the same field does not change, the field takes the value of 0 to obtain the device switch mutation evaluation vector. S62. Convert the equipment numerical mutation evaluation vector and the equipment switch mutation evaluation vector into mutation sub-vectors of the same dimension. Perform splicing and normalization processing on the two types of mutation sub-vectors to obtain the mutation fusion vector. Calculate the average value of each dimension of the mutation fusion vector to obtain the equipment status mutation evaluation value corresponding to the video frame. S63. Read the equipment state change evaluation values corresponding to all video frames in the same operation step, calculate their average value and standard deviation, add the average value and standard deviation to obtain the change judgment value in the step, and when the equipment state change evaluation value corresponding to a certain video frame is greater than the change judgment value in the step, the video frame is determined as the equipment state change point. S64. Read the risk scan status corresponding to the equipment status mutation point in the risk scan status representation, normalize the equipment status mutation evaluation value to the range of 0 to 1 to obtain the mutation enhancement coefficient; multiply the risk scan status vector with the mutation enhancement coefficient dimension by dimension to obtain the mutation enhancement component, and add the risk scan status vector with the mutation enhancement component dimension by dimension to obtain the mutation point enhancement status vector. S65. Write the mutation point enhancement state vector into the video frame position corresponding to the device state mutation point. For video frames that are not corresponding to mutation points, retain the risk scan state vector corresponding to the video frame. Arrange the mutation point enhancement state vector and the risk scan state vector that are not corresponding to mutation points according to the video frame timestamp to obtain the mutation enhancement state representation.
[0011] Furthermore, S7 specifically includes: S71. Input the mutation enhancement state representation and standard operation video recording into the scoring correction layer. Read the mutation enhancement state representation, step boundary awareness temporal representation, risk scan state representation, and frame-level device state features. Perform mean normalization on the step boundary awareness temporal representation corresponding to the current video frame to obtain the step state sub-vector. Perform maximum value normalization on the risk scan state representation corresponding to the current video frame to obtain the risk state sub-vector. Perform mean normalization on the mutation enhancement state representation corresponding to the current video frame to obtain the mutation state sub-vector. Calculate the difference and compare the state changes between the frame-level device state features corresponding to the current video frame and the frame-level device state features corresponding to the previous video frame to generate the device change sub-vector. Concatenate the step state sub-vector, risk state sub-vector, mutation state sub-vector, and device change sub-vector in sequence to generate a fused combination vector. Perform feature compression and normalization on the fused combination vector to generate a fused state representation. S72. Read the time-corresponding video frame sequence from the standard operation video recording, and calculate the brightness degradation, sharpness degradation, occlusion degradation, and stability degradation for the current video frame. The brightness degradation is generated by counting the number of overly bright and overly dark pixels in the current video frame, adding the two numbers together, and dividing by the total number of pixels in the current video frame. The sharpness degradation is generated by performing Sobel edge gradient calculation on the current video frame, obtaining the mean edge gradient, normalizing the mean edge gradient, and subtracting the normalization result from 1 to obtain the sharpness degradation. The occlusion degradation is generated by reading the equipment area, instrument area, hand movement area, and tool area in the current video frame, calculating the ratio of the sum of the occluded areas in these areas to the total area of these areas, and obtaining the occlusion degradation. The stability degradation is generated by calculating the ratio of the current video frame to the previous... The image displacement between video frames is calculated, and the image displacement is divided by the diagonal length of the video frame to obtain the stable degradation amount. The brightness degradation amount, sharpness degradation amount, occlusion degradation amount, and stable degradation amount are arranged in order to generate an environmental degradation evaluation vector. The environmental degradation evaluation vector is read, and the brightness degradation amount, occlusion degradation amount, and stable degradation amount are added together and divided by three to obtain the visual interference amount. The sharpness degradation amount is used as the sharpness loss amount. The visual interference amount and the sharpness loss amount are concatenated to generate a degradation combination vector. The degradation combination vector is linearly mapped to generate a degradation correction vector with the same dimensions as the fusion state representation. The degradation correction vector is range-compressed using the Sigmoid function so that the value of each dimension in the degradation correction vector is in the range of 0 to 1. The degradation correction vector is subtracted from 1 to obtain the effective retention vector. The fusion state representation is multiplied by the effective retention vector according to the corresponding dimensions to obtain the corrected state representation. S73. Based on the corrected state vector corresponding to each video frame in the corrected state representation, divide it into step response segment, risk response segment, mutation response segment, and visually effective response segment according to the fixed dimension order of the corrected state vector; calculate the average value of each dimension value in the step response segment, risk response segment, mutation response segment, and visually effective response segment to obtain the step completion score, risk node score, equipment mutation score, and visually effective score; perform weighted summation of the step completion score, risk node score, equipment mutation score, and visually effective score to obtain the original score of a single frame; perform maximum and minimum normalization processing on the original scores of the single frames corresponding to all video frames in the same standard operation video to generate the key frame importance score corresponding to each video frame. S74. Based on the keyframe importance score, select candidate keyframes within the video frame range corresponding to each SOP structured step sequence. Within the video frame range corresponding to each SOP step, sort the video frames according to the keyframe importance score from largest to smallest, and select video frames sequentially according to the minimum time interval between adjacent keyframes to generate a candidate keyframe set. Read the risk nodes in the SOP structured step sequence, and determine the video frame range corresponding to each risk node based on the step calibration results. Check whether there are candidate keyframes in the candidate keyframe set that are located within the video frame range corresponding to each risk node, and generate risk node coverage results. When a risk node is not covered, within the video frame range corresponding to that risk node, determine the video frame that meets the picture quality conditions and has the highest keyframe importance score as a supplementary keyframe. Sort the candidate keyframe set and the supplementary keyframes according to the video frame timestamp to generate a standard operation video keyframe set.
[0012] The beneficial effects of this invention are: This invention proposes a deep learning-based method for extracting keyframes from standard operation videos. The method uses the VideoMamba model to extract keyframes from standard operation videos. The VideoMamba model's multi-source construction layer generates a multi-source token sequence and step boundary indexes, ensuring that each video frame's token simultaneously carries visual information, step semantics, step calibration information, and equipment status information. The segmented scanning layer segments the multi-source token sequence based on the step boundary indexes, performs bidirectional selective state space scanning within each step sub-sequence, and performs gating propagation on adjacent step sub-sequences. This allows the model to simultaneously represent the action evolution process within a single operation step and the connection relationship between adjacent operation steps, reducing keyframe omissions caused by unclear step boundary identification in ordinary whole-segment video modeling. The risk scanning layer generates risk gating weights based on frame-level equipment status features and uses these weights for risk-weighted selective state space scanning, enabling changes in equipment values, equipment switching, and risk node information to participate in keyframe importance judgment. The mutation correction layer detects equipment state mutation points based on frame-level equipment state characteristics and performs mutation point reset and enhancement processing on the risk scan state representation, so that nodes with insignificant screen changes but strong safety significance, such as pressure changes, valve state switching, equipment start-up and shutdown changes, and gas detection changes, can be prioritized and retained. The scoring correction layer combines mutation enhancement state representation, environmental degradation assessment, and risk node coverage verification to generate key frame importance scores and a set of key frames for standard operation videos, so that the output key frames simultaneously meet the requirements of operation step coverage, risk node coverage, equipment state mutation coverage, and usable image quality. This invention uses the VideoMamba model to extract key frames for standard operation videos, which has the advantages of complete step coverage, accurate risk identification, and high image usability. Attached Figure Description
[0013] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is an overall flowchart of a deep learning-based method for extracting keyframes from standard operation videos proposed in this invention. Figure 2 This is a schematic diagram of the internal hierarchy and data flow of the VideoMamba model for a standard operation video keyframe extraction method based on deep learning proposed in this invention. Figure 3 This is a flowchart illustrating the progressive processing of the segmented scanning layer, risk scanning layer, and mutation correction layer in a standard operation video keyframe extraction method based on deep learning proposed in this invention. Detailed Implementation
[0014] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0015] refer to Figure 1-3 A video keyframe extraction method integrating self-supervised deep learning includes the following steps: S1. Collect standard operation videos and preprocess them, read the standard operation related data, and generate standard operation video records; S2. Based on standard operation video recordings, generate SOP structured step sequences, step calibration results, and frame-level device status characteristics; S3. Input the standard operation video recording, SOP structured step sequence, step calibration results and frame-level device status features into the multi-source construction layer of the VideoMamba model to generate a multi-source token sequence and step boundary index for the operation; S4. Input the step boundary index and the job multi-source token into the segmented scanning layer of the VideoMamba model to generate a step boundary-aware temporal representation; S5. Input the step boundary-aware temporal representation and frame-level device state features into the risk scanning layer of the VideoMamba model to generate a risk scanning state representation. S6. Input the frame-level device state features into the mutation correction layer of the VideoMamba model to generate a mutation-enhanced state representation; S7. The mutation-enhanced state representation, step boundary-aware temporal representation, risk scanning state representation, and frame-level device state features are used as inputs to the scoring correction layer of the VideoMamba model to perform state fusion and environmental degradation correction, generating a set of standard operation video keyframes.
[0016] The S1 specifically includes: S11. Acquire standard operation video, which includes video stream and audio stream; extract video frame sequence arranged according to acquisition time from video stream; perform frame rate unification using linear frame interpolation, resolution unification using bilinear interpolation, brightness equalization using contrast-limited adaptive histogram equalization, and image stabilization processing using ORB feature matching on video frame sequence; perform noise reduction processing on audio stream using spectral subtraction; perform unified calibration based on display timestamp of video frame and sampling timestamp of audio sampling point to complete timestamp calibration of video frame sequence and audio stream, and obtain preprocessed video frame sequence and preprocessed audio data; S12. Read the standard operation association data, which comes from the MES, equipment management, and standard operation system, including the task identifier, equipment identifier, standard operation file identifier, task start time, task end time, and equipment status data source identifier; based on the task start time, task end time, and video frame sequence acquisition time, generate video frame timestamps corresponding to the preprocessed video frame sequence; using the video frame timestamps as a reference, employ a timestamp-based nearest neighbor matching algorithm to perform time correspondence processing on each video frame and the preprocessed audio data within the same time range, generating a time-corresponding video frame sequence. The audio data is time-corresponding; the corresponding video segment time range and audio segment time range are determined by the video frame timestamp; a correspondence is established between the video frame identifier and the audio segment identifier for video frame timestamps falling within the same 1-second time window; and the task identifier, video frame identifier, video segment time range, audio segment identifier, and audio segment time range are written into the same associated record to generate video-audio associated data; wherein, the video frame identifier is a unique identifier generated according to the arrangement order of the video frames in the time-corresponding video frame sequence, and the audio segment identifier is a unique identifier generated according to the segmentation order of the audio segments in the time-corresponding audio data; S13. Use the time-corresponding video frame sequence, time-corresponding audio data, video frame timestamps, standard operation association data, and video-audio association data as the data of the standard operation video recording data structure to generate a standard operation video record.
[0017] The S2 specifically includes: S21. Read the standard operation associated data, call the corresponding standard operation file according to the standard operation file identifier, write the step number, step name, operation object, action requirements, safety matters and risk nodes in the standard operation file into the structured step table, and generate the SOP structured step sequence according to the step number. S22. Read the video and audio association data in the standard operation video recording, extract the corresponding audio segments according to the audio segment identifier and audio segment time range, perform feature extraction and speech-to-text processing on the audio segments to obtain the spoken segment text, extract the operation object words, action words and confirmation words from the spoken segment text, match the above words with the step name, operation object and action requirements in the SOP structured step sequence to obtain the step number corresponding to each video frame, and generate the step calibration result; S23. Read the equipment status data source identifier in the standard operation associated data, obtain the equipment status data corresponding to the standard operation video record, align the numerical status and switch status in the equipment status data to the corresponding video frame according to the video frame timestamp, and generate the frame-level equipment status feature corresponding to each video frame; wherein the numerical status includes temperature, pressure, current, voltage and gas detection value, and the switch status includes valve opening and closing status, equipment start and stop status, power failure status and tag confirmation status.
[0018] The S3 specifically includes: S31. The multi-source construction layer of the VideoMamba model is based on the time-corresponding video frame sequence and video frame timestamp in the standard operation video recording. A YOLO object detection network is used to perform target region detection on each video frame, obtaining equipment region images, instrument region images, hand action region images, and tool region images. Convolutional feature extraction is performed on the above region images using a ResNet convolutional neural network with the classification output layer removed. After convolution processing and global average pooling, feature vectors for the equipment region, instrument region, hand action region, and tool region are obtained. These four types of feature vectors are sequentially concatenated to generate a frame-level image combination vector. An affine transformation is performed on the frame-level image combination vector using a fully connected layer linear projection function to obtain a fixed-dimensional frame visual token vector. The frame visual token vector corresponding to each video frame is arranged according to the video frame timestamp to generate a frame visual token sequence. The data structure of the frame visual token vector includes a video frame identifier, a video frame timestamp, and a frame visual feature vector. S32. Read each work step record in the SOP structured step sequence. The work step record includes step number, step name, operation object, action requirement, safety matter, and risk node. Use a dictionary-based maximum forward matching word segmentation algorithm to segment different work step records to obtain a set of word terms for step name, operation object, action requirement, safety matter, and risk node. Encode the word terms for each set and use a dot product attention mechanism to calculate the attention weight of each word vector. Sum the word vectors according to the attention weight to obtain the step name encoding vector, operation object encoding vector, action requirement encoding vector, safety matter encoding vector, and risk node encoding vector. Convert the step number into a step sequence encoding vector. Concatenate the above encoding vectors in order and perform an affine transformation to generate a step semantic token. Arrange the step semantic tokens corresponding to each work step according to the step number to generate a step semantic token sequence. S33. Based on the step calibration results, for any video frame, according to the step number corresponding to the video frame, search for a step semantic token with the same step number in the step semantic token sequence, and concatenate the frame visual feature vector in the frame visual token vector corresponding to the video frame with the found step semantic token to obtain a frame step concatenation vector; perform affine transformation and normalization processing on the frame step concatenation vector to generate the step alignment token vector corresponding to the video frame; arrange the step alignment token vectors corresponding to all video frames according to the video frame timestamp to generate a step alignment token sequence. S34. Read the frame-level device status features, normalize the device status values to obtain a numerical status vector, and binarize the device switch status to obtain a switch status vector; concatenate the numerical status vector and the switch status vector in a fixed order to generate a frame-level device status combination vector; perform linear mapping and normalization on the frame-level device status combination vector to generate a device status token vector; arrange the device status token vector corresponding to each video frame according to the video frame timestamp to generate a device status token sequence. S35. Using the video frame timestamp as the alignment reference, perform frame-matching on the step alignment token vector and the device status token vector corresponding to the same video frame timestamp. For any video frame, concatenate the step alignment token vector and the device status token vector corresponding to the video frame to generate a multi-source combined vector. Perform an affine transformation on the multi-source combined vector to obtain the job multi-source token vector. Arrange all job multi-source token vectors according to the video frame timestamp to generate a job multi-source token sequence. S36. Read the step number corresponding to each video frame in the step calibration result, and compare the step numbers of adjacent video frames frame by frame according to the video frame timestamp. When the step numbers of adjacent video frames are different, record the position of the next video frame as the start position of the new step, and record the position of the previous video frame as the end position of the previous operation step. Generate a step boundary index based on the start and end positions of each operation step.
[0019] The S4 specifically includes: S41. Input the step boundary index and the multi-source token sequence of the job into the segmented scanning layer of the VideoMamba model; the segmented scanning layer of the VideoMamba model includes a subsequence partitioning unit, a bidirectional scanning unit, a gated transfer unit, and a timing representation output unit. S42. The subsequence partitioning unit reads the multi-source token sequence and step boundary index of the job, and divides the multi-source token vectors of the job that are located between the start and end positions of the same job step into the same step subsequence. S43. The bidirectional scanning unit performs bidirectional selective state space scanning on the multi-source token vector of the job in each step subsequence: it performs forward selective state space scanning along the increasing direction of the video frame timestamp to obtain the forward step scanning state, and performs reverse selective state space scanning along the decreasing direction of the video frame timestamp to obtain the reverse step scanning state; for the same token position in the same step subsequence, the forward step scanning state is used as the first half vector and the reverse step scanning state is used as the second half vector, and they are connected according to the feature dimension to generate a bidirectional state combination vector. The bidirectional state combination vector is linearly mapped to restore it to the same fixed dimension as the multi-source token vector of the job, and then normalized to generate the in-step scanning state; The specific steps for generating the forward step scan state include: reading the job multi-source token vector in the step sub-sequence according to the increasing direction of the video frame timestamp; when the current job multi-source token vector is the first token vector in the step sub-sequence, initializing the previous forward scan state and the forward retention coefficient to zero vectors, initializing the forward write coefficient to an all-one vector, and generating a forward candidate state vector based on the current job multi-source token vector; using the forward candidate state vector as the forward step scan state at the current token position; when the current job multi-source token vector is not the first token vector in the step sub-sequence, processing the current job multi-source token vector to generate the forward retention coefficient, the forward write coefficient, and the forward candidate state vector; multiplying the previous forward scan state and the forward retention coefficient element by element to obtain the retained historical state; multiplying the forward candidate state vector and the forward write coefficient element by element to obtain the current state after writing; and adding the retained historical state and the current state after writing element by element to obtain the forward step scan state at the current token position. The specific steps for generating positive retention coefficients include: reading the step name component, operation object component, action requirement component, safety matter component, visual action component, equipment numerical status component, and equipment on / off status component from the current job's multi-source token vector; reading the positive step scan status of the previous token position; calculating the cosine similarity between the step name component of the current token position and the step name component of the previous token position to obtain the step continuity evaluation value; calculating the cosine similarity between the operation object component of the current token position and the operation object component of the previous token position to obtain the object continuity evaluation value; calculating the difference between the equipment numerical status component of the current token position and the equipment numerical status component of the previous token position and taking the absolute value to obtain the equipment numerical change value; and calculating the difference between the equipment on / off status component of the current token position and the equipment on / off status component of the previous token position. The quantities are compared by XOR, and dimensions with the same state are marked as 0, while dimensions with different states are marked as 1, to obtain the device switching change quantity. The device numerical change quantity is normalized to obtain the device numerical change normalized quantity. The device switching change quantity is binarized to obtain the device switching change identifier. The step continuous evaluation quantity, object continuous evaluation quantity, device numerical change normalized quantity, and device switching change identifier are concatenated in sequence to obtain the retention combination vector. The device numerical change normalized quantity and device switching change identifier are subtracted by 1 to obtain the device numerical retention tendency quantity and the device switching retention tendency quantity. The step continuous evaluation quantity, object continuous evaluation quantity, device numerical retention tendency quantity, and device switching retention tendency quantity are concatenated in sequence to obtain the retention correction vector. The fully connected layer with the same input and output dimensions as the forward step scan state dimensions is subjected to affine mapping to generate the positive retention evaluation vector. The positive retention evaluation vector is normalized to obtain the positive retention coefficient. The specific steps for generating positive write coefficients include: reading the action requirement component, safety matter component, visual action component, device numerical status component, and device on / off status component from the multi-source token vector of the current job; calculating the difference between the action requirement component at the current token position and the action requirement component at the previous token position, specifically by calculating the cosine similarity between the action requirement component at the current token position and the action requirement component at the previous token position, and subtracting the cosine similarity from 1 to obtain the action change evaluation quantity; calculating the cosine similarity between the safety matter component at the current token position and the risk node component of the corresponding step in the SOP structured step sequence to obtain the safety matter hit evaluation quantity; calculating the difference between the visual action component at the current token position and the visual action component at the previous token position to obtain the visual action change quantity; calculating the difference between the device numerical status component at the current token position and the device numerical status component at the previous token position and taking the absolute value to obtain the device numerical change quantity; and comparing the state change of the device on / off status component at the current token position and the device on / off status component at the previous token position, specifically by comparing the state change of the current token... The device switch state component at the current location is XORed with the device switch state component at the previous token location. Dimensions with the same state are marked as 0, and dimensions with different states are marked as 1, resulting in the device switch change quantity. The action change evaluation quantity, safety event hit evaluation quantity, visual action change quantity, device value change quantity, and device switch change quantity are each converted into a write sub-vector of the same dimension. The write sub-vector corresponding to the action change evaluation quantity and the write sub-vector corresponding to the visual action change quantity are then subjected to a dimensional maximum-value process to obtain the action write response vector. The write sub-vector corresponding to the device value change quantity is then compared with the device switch change quantity. The corresponding write sub-vector is processed by taking the maximum value of each dimension to obtain the device write response vector; the write sub-vector corresponding to the safety event hit evaluation quantity is used as the safety write response vector; based on the keyframe annotation results of the training samples, the action write weight, safety write weight and device write weight are determined in the validation set with the condition of the maximum F1 value of keyframe recognition. The three types of write weights are used to weight the obtained action write response vector, safety write response vector and device write response vector respectively. The weighted results are added dimension by dimension to generate a positive write evaluation vector. The positive write evaluation vector is normalized to obtain the positive write coefficient. The specific steps for generating positive candidate state vectors include: scaling the step name component, operation object component, action requirement component, safety matter component, visual action component, equipment numerical state component, and equipment switch state component in the current job's multi-source token vector; specifically, firstly, performing an affine transformation to convert each component into an intermediate vector of the same dimension; then, using a layer normalization method to normalize the mean and variance of each intermediate vector to obtain unified components for step name, operation object, action requirement, safety matter, visual action, equipment numerical state, and equipment switch state; and sequentially concatenating these components to generate a candidate state combination vector; and then performing feature compression on the candidate state combination vector; specifically, performing linear projection dimensionality reduction on the candidate state combination vector through a fully connected layer with an output dimension smaller than the input dimension, compressing the candidate state combination vector to the same dimension as the positive step scan state, and then performing layer normalization on the dimensionality reduction result to obtain the positive candidate state vector. The specific steps for generating the reverse step scan state include: reading the current job multi-source token vector in the step sub-sequence according to the decreasing direction of the video frame timestamp, specifically including the step name component, operation object component, action requirement component, safety matter component, visual action component, device numerical status component, and device on / off status component; performing retention mapping, write mapping, and candidate state mapping on the above components respectively to generate reverse retention coefficient, reverse write coefficient, and reverse candidate state vector; multiplying the reverse step scan state of the next token position with the reverse retention coefficient element by element to obtain the historical state after reverse retention; multiplying the reverse candidate state vector with the reverse write coefficient element by element to obtain the current state after reverse write; and adding the historical state after reverse retention element by element with the current state after reverse write to obtain the reverse step scan state of the current token position. The specific steps for generating the reverse retention coefficients include: reading the current job multi-source token vector in the step sub-sequence according to the decreasing direction of the video frame timestamp, and reading the reverse step scan state at the next token position; calculating the cosine similarity between the step name component at the current token position and the step name component at the next token position to obtain the reverse step continuous evaluation value; calculating the cosine similarity between the operation object component at the current token position and the operation object component at the next token position to obtain the reverse object continuous evaluation value; calculating the difference between the device numerical state component at the current token position and the device numerical state component at the next token position and taking the absolute value to obtain the reverse device numerical change value; performing an XOR comparison between the device on / off state component at the current token position and the device on / off state component at the next token position, recording the dimension with the same state as 0 and the dimension with different states as 1 to obtain the reverse device on / off change value; normalizing the reverse device numerical change value to obtain the reverse device numerical change normalized value; and binarizing the reverse device on / off change value to obtain the reverse device on / off change identifier. Subtracting the reverse device numerical change normalization factor from 1 yields the reverse device numerical retention tendency factor. Subtracting the reverse device switch change flag from 1 yields the reverse device switch retention tendency factor. The reverse step continuous evaluation factor, reverse object continuous evaluation factor, reverse device numerical retention tendency factor, and reverse device switch retention tendency factor are concatenated sequentially to obtain the reverse retention correction vector. An affine transformation is performed on the fully connected layer whose input / output dimensions match the reverse step scan state dimension to generate the reverse retention evaluation vector. The reverse retention evaluation vector is then normalized to obtain the reverse retention coefficients. (The process is repeated three times in the original text.) The specific steps for generating reverse write coefficients include: following the method for generating forward write coefficients, calculating the difference between the action requirement component at the current token position and the action requirement component at the next token position to obtain a reverse action change evaluation quantity; calculating the cosine similarity between the security matter component at the current token position and the risk node of the corresponding step in the SOP structured step sequence to obtain a reverse security matter hit evaluation quantity; calculating the difference between the visual action component at the current token position and the visual action component at the next token position to obtain a reverse visual action change quantity; calculating the difference between the device numerical state component at the current token position and the corresponding component at the next token position and taking the absolute value as the reverse device numerical change quantity; performing an XOR comparison between the device on / off state component at the current token position and the device on / off state component at the next token position, recording dimensions with the same state as 0, and recording the state as... Different dimensions are denoted as 1 to obtain the reverse device switch change quantity; the reverse action change evaluation quantity, reverse security event hit evaluation quantity, reverse visual action change quantity, and reverse device state change quantity are converted into reverse write sub-vectors of the same dimension. The reverse write sub-vectors corresponding to the reverse action change evaluation quantity and the reverse write sub-vectors corresponding to the reverse visual action change quantity are subjected to dimension-wise maximum value processing to obtain the reverse action write response vector; the reverse write sub-vectors corresponding to the reverse device numerical change quantity are used as the reverse device numerical write response vectors, and the reverse write sub-vectors corresponding to the reverse device switch change quantity are used as the reverse device switch write response vectors; the reverse action write response vectors, the reverse write sub-vectors corresponding to the reverse security event hit evaluation quantity, the reverse device numerical write response vectors, and the reverse device switch write response vectors are weighted and accumulated to generate the reverse write evaluation vectors. The reverse write evaluation vectors are normalized to obtain the reverse write coefficients. The specific steps for generating the reverse candidate state vector include: according to the generation method of the forward candidate state vector, the step name component, operation object component, action requirement component, safety matter component, visual action component, equipment numerical state component and equipment switch state component in the current job multi-source token vector are scaled uniformly, and sequentially concatenated to generate the reverse candidate state combination vector. The reverse candidate state combination vector is then subjected to feature compression and normalization to obtain the reverse candidate state vector. The specific steps for generating the reverse scan state include: reading the current job multi-source token vector in the step sub-sequence according to the decreasing direction of the video frame timestamp; when the current job multi-source token vector is the last token vector in the step sub-sequence, initializing the reverse step scan state and reverse retention coefficient of the next token position to zero vectors, initializing the reverse write coefficient to an all-one vector, and generating a reverse candidate state vector based on the current job multi-source token vector; using the reverse candidate state vector as the reverse step scan state of the current token position; when the current job multi-source token vector is not the last token vector in the step sub-sequence, multiplying the reverse step scan state of the next token position with the reverse retention coefficient according to the corresponding dimension to obtain the reverse retention state; multiplying the reverse candidate state vector with the reverse write coefficient according to the corresponding dimension to obtain the reverse write state; and adding the reverse retention state and the reverse write state according to the corresponding dimension to obtain the reverse step scan state of the current token position. S44. Input the in-step scan state corresponding to the adjacent step sub-sequence into the gating transfer unit, read the in-step scan state corresponding to the end token of the previous SOP step and the starting token vector of the next SOP step. The in-step scan state corresponding to the end token of the previous SOP step is generated by retaining the safety matter state interval, equipment state interval, and action completion state interval according to the position of the state components. The gating transfer unit reads the preceding safety matter state component from the safety matter state interval, the preceding equipment state component from the equipment state interval, and the preceding action completion state component from the action completion state interval. The starting token vector of the next SOP step is composed of a fixed order of step name component, operation object component, action requirement component, safety matter component, visual action component, equipment numerical state component, and equipment switch state component. The gating transfer unit reads the subsequent operation object component from the operation object component position, the subsequent action requirement component from the action requirement component position, and the subsequent safety matter component from the safety matter component position. The preceding safety event status component is matched with the subsequent safety event component to generate a continuous safety event evaluation quantity. Specifically, the matching process involves calculating cosine similarity after same-dimensional mapping. The preceding device status component is matched with the subsequent operation object component to generate a continuous device object evaluation quantity. The preceding action completion status component is matched with the subsequent action requirement component to generate an action connection evaluation quantity. The continuous safety event evaluation quantity, the continuous device object evaluation quantity, and the action connection evaluation quantity are converted into same-dimensional sub-vectors and concatenated in the order of safety association, device association, and action association to generate a cross-step concatenation vector. The cross-step concatenation vector is then segmented, normalized, and weighted to obtain a cross-step association evaluation vector. The cross-step association evaluation vector is normalized again to generate step transmission weights. The step-by-step scan state corresponding to the end token of the previous SOP step is multiplied element-wise with the step transmission weights to obtain the cross-step transmission state. The cross-step transmission state is written into the step-by-step scan state corresponding to the start token of the next SOP step to generate a cross-step scan state. The specific steps for generating continuous safety event evaluation metrics, continuous equipment object evaluation metrics, and action connection evaluation metrics include: normalizing the preceding safety event state component and the subsequent safety event component into safety event vectors of the same dimension, calculating their cosine similarity to obtain a safety event semantic similarity value, multiplying the safety event semantic similarity value by a confirmation completion flag to obtain a continuous safety event evaluation metric, where the confirmation completion flag is a flag with a value of 0 or 1; reading the equipment identifier vector and equipment state change vector from the preceding equipment state component, reading the operation object vector from the subsequent operation object component, calculating the cosine similarity between the equipment identifier vector and the operation object vector to obtain an equipment object similarity value, and then calculating the continuous safety event evaluation metric based on the equipment state change... The state change amplitude in the vector is used to generate the effective value of the device state. The device object similarity value is multiplied by the effective value of the device state to obtain the continuous evaluation value of the device object. The preceding action type vector and action completion identifier are read from the preceding action completion state component, and the subsequent action type vector is read from the subsequent action requirement component. The cosine similarity of the action connection between the preceding action type vector and the subsequent action type vector is calculated. The step adjacency relationship between the previous SOP step and the next SOP step in the SOP structured step sequence is read. The cosine similarity of the action connection, the action completion identifier and the step adjacency relationship are multiplied to obtain the action connection evaluation value. The action completion identifier and the step adjacency relationship are both identifiers with values of 0 or 1. S45. The timing representation output unit fuses the in-step scan state and the cross-step scan state: the cross-step transmission state is written to the starting token position of the next SOP step, the starting token position and the current token position of the next SOP step are read, the token interval number between the current token position and the starting token position is calculated, the token interval number is added by 1 to obtain the interval adjustment value, the reciprocal of the interval adjustment value is used as the initial attenuation amount, the initial attenuation amount corresponding to all token positions in the next SOP step is normalized to obtain the transmission attenuation coefficient corresponding to each token position; the cross-step transmission state is multiplied element by element by the transmission attenuation coefficient to obtain the cross-step attenuation state transmitted to the current token position, the in-step scan state and the cross-step attenuation state of the current token position are weighted and summed to obtain the step boundary awareness timing vector of the current token position, and the step boundary awareness timing vectors of all token positions are arranged according to the video frame timestamp to generate the step boundary awareness timing representation.
[0020] The S5 specifically includes: S51. Input the step boundary-aware timing representation and frame-level device state features into the risk scanning layer. The risk scanning layer includes a state change evaluation unit, a risk gating weight generation unit, a risk weighted scanning unit, and a scanning state output unit. S52. In the risk scanning layer, the state change evaluation unit reads the equipment numerical states corresponding to the current video frame and the previous video frame, performs difference calculations on the corresponding dimensions of temperature, pressure, current, voltage, and gas detection values, and takes the absolute value of the difference results to obtain the original change amount of each equipment numerical field. The unit performs maximum value normalization processing on each original change amount to obtain the equipment numerical change evaluation amount. The unit reads the equipment switch states corresponding to the current video frame and the previous video frame, performs XOR comparison on the corresponding dimensions of valve opening / closing state, equipment start / stop state, power failure state, and tag confirmation state. When the equipment switch state of the same dimension changes, the value of that dimension is 1; when the equipment switch state of the same dimension does not change, the value of that dimension is 0. The XOR comparison results of each dimension are arranged in the order of valve opening / closing state, equipment start / stop state, power failure state, and tag confirmation state to generate the equipment switch change evaluation vector. S53. Input the step boundary perception timing representation, equipment numerical change evaluation quantity, and equipment switch change evaluation quantity into the risk gating weight generation unit for risk gating fusion encoding processing: Read the risk node state component corresponding to the current video frame from the step boundary perception timing representation, where the risk node state component is used to represent the safety matters and risk nodes in the standard operation step to which the current video frame belongs; Segment and splice the risk node state component, equipment numerical change evaluation quantity, and equipment switch change evaluation quantity in the order of risk node, numerical change, and switch change to obtain the risk gating combination vector; Perform segmented normalization processing on the risk gating combination vector to make the risk node segment, numerical change segment, and switch change segment in the same value range; Then, use the Sigmoid function to perform interval compression processing on the segmented normalization result to obtain the risk gating weight with a value in the range of 0 to 1; S54. The risk-weighted scanning unit reads each time-series vector in the step boundary perception time-series representation according to the video frame timestamp order, reads the current time-series vector in the step boundary perception time-series representation according to the video frame timestamp order, multiplies the risk gating weight with the previous risk scanning state according to the corresponding dimension to obtain the risk retention state, multiplies the current time-series vector with the risk gating weight according to the corresponding dimension to obtain the risk writing state, and adds the risk retention state and the risk writing state according to the corresponding dimension to obtain the current risk scanning state corresponding to the current video frame. S55. In the scanning status output unit, the current risk scanning status corresponding to each video frame is bound to the corresponding video frame timestamp, and a risk scanning status representation is generated according to the video frame timestamps.
[0021] Specifically, S6 includes: S61. Input the frame-level device status features and risk scan status representation into the mutation correction layer; read the device numerical status corresponding to adjacent video frames, subtract the values of the current video frame from the previous video frame in each device numerical field and take the absolute value to obtain the original numerical mutation amount; normalize the original numerical mutation amount according to the allowable value range of each device numerical field to obtain the device numerical mutation evaluation vector; read the device switch status corresponding to adjacent video frames, XOR the status of the current video frame from the previous video frame in each device switch field, and when the status of the same field changes, the field takes the value of 1, and when the status of the same field does not change, the field takes the value of 0 to obtain the device switch mutation evaluation vector. S62. Convert the equipment numerical mutation evaluation vector and the equipment switch mutation evaluation vector into mutation sub-vectors of the same dimension. Perform splicing and normalization processing on the two types of mutation sub-vectors to obtain the mutation fusion vector. Calculate the average value of each dimension of the mutation fusion vector to obtain the equipment status mutation evaluation value corresponding to the video frame. S63. Read the equipment state change evaluation values corresponding to all video frames in the same operation step, calculate their average value and standard deviation, add the average value and standard deviation to obtain the change judgment value in the step, and when the equipment state change evaluation value corresponding to a certain video frame is greater than the change judgment value in the step, the video frame is determined as the equipment state change point. S64. Read the risk scan status corresponding to the equipment status mutation point in the risk scan status representation, normalize the equipment status mutation evaluation value to the range of 0 to 1 to obtain the mutation enhancement coefficient; multiply the risk scan status vector with the mutation enhancement coefficient dimension by dimension to obtain the mutation enhancement component, and add the risk scan status vector with the mutation enhancement component dimension by dimension to obtain the mutation point enhancement status vector. S65. Write the mutation point enhancement state vector into the video frame position corresponding to the device state mutation point. For video frames that are not corresponding to mutation points, retain the risk scan state vector corresponding to the video frame. Arrange the mutation point enhancement state vector and the risk scan state vector that are not corresponding to mutation points according to the video frame timestamp to obtain the mutation enhancement state representation.
[0022] The S7 specifically includes: S71. Input the mutation enhancement state representation and standard operation video recording into the scoring correction layer. Read the mutation enhancement state representation, step boundary awareness temporal representation, risk scan state representation, and frame-level device state features. Perform mean normalization on the step boundary awareness temporal representation corresponding to the current video frame to obtain the step state sub-vector. Perform maximum value normalization on the risk scan state representation corresponding to the current video frame to obtain the risk state sub-vector. Perform mean normalization on the mutation enhancement state representation corresponding to the current video frame to obtain the mutation state sub-vector. Calculate the difference and compare the state changes between the frame-level device state features corresponding to the current video frame and the frame-level device state features corresponding to the previous video frame to generate the device change sub-vector. Concatenate the step state sub-vector, risk state sub-vector, mutation state sub-vector, and device change sub-vector in sequence to generate a fused combination vector. Perform feature compression and normalization on the fused combination vector to generate a fused state representation. S72. Read the time-corresponding video frame sequence from the standard operation video recording, and calculate the brightness degradation, sharpness degradation, occlusion degradation, and stability degradation for the current video frame. The brightness degradation is generated by counting the number of overly bright and overly dark pixels in the current video frame, adding the two numbers together, and dividing by the total number of pixels in the current video frame. The sharpness degradation is generated by performing Sobel edge gradient calculation on the current video frame, obtaining the mean edge gradient, normalizing the mean edge gradient, and subtracting the normalization result from 1 to obtain the sharpness degradation. The occlusion degradation is generated by reading the equipment area, instrument area, hand movement area, and tool area in the current video frame, calculating the ratio of the sum of the occluded areas in these areas to the total area of these areas, and obtaining the occlusion degradation. The stability degradation is generated by calculating the ratio of the current video frame to the previous... The image displacement between video frames is calculated, and the image displacement is divided by the diagonal length of the video frame to obtain the stable degradation amount. The brightness degradation amount, sharpness degradation amount, occlusion degradation amount, and stable degradation amount are arranged in order to generate an environmental degradation evaluation vector. The environmental degradation evaluation vector is read, and the brightness degradation amount, occlusion degradation amount, and stable degradation amount are added together and divided by three to obtain the visual interference amount. The sharpness degradation amount is used as the sharpness loss amount. The visual interference amount and the sharpness loss amount are concatenated to generate a degradation combination vector. The degradation combination vector is linearly mapped to generate a degradation correction vector with the same dimensions as the fusion state representation. The degradation correction vector is range-compressed using the Sigmoid function so that the value of each dimension in the degradation correction vector is in the range of 0 to 1. The degradation correction vector is subtracted from 1 to obtain the effective retention vector. The fusion state representation is multiplied by the effective retention vector according to the corresponding dimensions to obtain the corrected state representation. S73. Based on the corrected state vector corresponding to each video frame in the corrected state representation, divide it into step response segment, risk response segment, mutation response segment, and visually effective response segment according to the fixed dimension order of the corrected state vector; calculate the average value of each dimension value in the step response segment, risk response segment, mutation response segment, and visually effective response segment to obtain the step completion score, risk node score, equipment mutation score, and visually effective score; perform weighted summation of the step completion score, risk node score, equipment mutation score, and visually effective score to obtain the original score of a single frame; perform maximum and minimum normalization processing on the original scores of the single frames corresponding to all video frames in the same standard operation video to generate the key frame importance score corresponding to each video frame. S74. Based on the keyframe importance score, select candidate keyframes within the video frame range corresponding to each SOP structured step sequence. Within the video frame range corresponding to each SOP step, sort the video frames according to the keyframe importance score from largest to smallest, and select video frames sequentially according to the minimum time interval between adjacent keyframes to generate a candidate keyframe set. Read the risk nodes in the SOP structured step sequence, and determine the video frame range corresponding to each risk node based on the step calibration results. Check whether there are candidate keyframes in the candidate keyframe set that are located within the video frame range corresponding to each risk node, and generate risk node coverage results. When a risk node is not covered, within the video frame range corresponding to that risk node, determine the video frame that meets the picture quality conditions and has the highest keyframe importance score as a supplementary keyframe. Sort the candidate keyframe set and the supplementary keyframes according to the video frame timestamp to generate a standard operation video keyframe set.
[0023] Example 1: To verify the feasibility of this invention in practice, it was applied to a standard operation video management scenario in an aluminum production enterprise. The enterprise's production site covers standard operations such as electrolytic cell inspection, valve opening / closing confirmation, gas detection confirmation, power outage tagging confirmation, protective equipment donning confirmation, and equipment status verification. When performing standard operations, workers wear video capture terminals to simultaneously capture first-person perspective video and audio streams. The video records hand gestures, instrument checks, equipment operations, and changes in the on-site environment, while the audio records verbal cues. Due to strong light reflection, equipment noise, partial obstruction, and image shakiness, manually searching for key frames in long-term video is time-consuming and prone to missing seemingly insignificant but safety-critical points such as gas detection, power outage tagging, and valve status switching. In application, the system first captures and preprocesses the standard operation video, then reads the associated standard operation data to form a standard operation video record. Subsequently, the system calls the corresponding standard operating procedure (SOP) file to generate a structured sequence of steps. It then identifies spoken text from audio clips and calibrates spoken phrases such as "Gas detection qualified," "Valve closed," "Tag completed," and "Protective equipment worn" against the structured SOP sequence to establish the correspondence between video frames and operational steps. Simultaneously, the system aligns temperature, pressure, current, voltage, gas detection values, valve open / closed status, equipment start / stop status, power-off status, and tag confirmation status according to the video frame timestamps, generating frame-level equipment status features.
[0024] After multi-source alignment, the system inputs standard operation video recordings, SOP structured step sequences, step calibration results, and frame-level equipment status features into the VideoMamba model. The multi-source construction layer generates a multi-source token sequence and step boundary indexes for the operation. The segmented scanning layer divides the continuous video into step sub-sequences according to step boundaries and performs bidirectional selective state space scanning, preserving the action evolution process within each operation step and the safety connections between adjacent steps. The risk scanning layer generates risk gating weights based on frame-level equipment status features, allowing equipment status changes and risk node information to participate in keyframe judgment. The mutation correction layer enhances equipment status mutation points such as pressure release, gas detection value changes, valve status switching, power outage tagging completion, and electrolytic cell current and voltage changes, avoiding the omission of safety confirmation nodes when extracting keyframes solely based on image changes.
[0025] The scoring correction layer takes abrupt change enhancement state representation, step boundary awareness temporal representation, risk scan state representation, and frame-level device state features as inputs to perform state fusion and environmental degradation correction, generating a set of keyframes for standard operating procedure (SOP) videos. For overexposed, blurry, severely occluded, or obviously shaky video frames, the system combines environmental degradation evaluation for correction and selects frames with more suitable image quality within adjacent time ranges. The final keyframe set not only covers each SOP step but also risk nodes such as gas detection confirmation, power outage tagging confirmation, valve status confirmation, electrolytic cell status confirmation, protective equipment confirmation, and operation completion confirmation, facilitating safety officers' debriefing, training personnel's creation of demonstration materials, and auditors' rapid location of key segments.
[0026] To facilitate the explanation of the technical effects of the present invention, several batches of standard operation videos from an aluminum production plant were selected as verification samples. The samples covered operations such as electrolytic cell inspection, valve opening and closing confirmation, gas detection confirmation, power outage tagging confirmation, protective equipment confirmation, and equipment status verification. On-site verification records, SOP step records, equipment status curves, and safety officer annotation results were used as comparison criteria.
[0027] Table 1 As shown in Table 1, the fixed-interval frame extraction and inter-frame difference methods are weak in terms of keyframe accuracy, risk node coverage, and device mutation node capture rate. This is mainly because these methods rely on time intervals or screen changes and cannot recognize verbal confirmations and device status changes.
[0028] While CNN-LSTM summarization models and the general VideoMamba approach outperform traditional methods in temporal modeling, achieving keyframe accuracies of 82.6% and 86.9%, respectively, their inputs are still primarily visual content, with insufficient utilization of SOP step boundaries, risk nodes, and frame-level device states. Therefore, their risk node coverage and device mutation node capture rates are still lower than those of this invention. The method of this invention achieves a keyframe accuracy of 94.3%, an SOP step coverage of 97.1%, a risk node coverage of 96.4%, and a device mutation node capture rate of 95.2%. This demonstrates that the VideoMamba model can further utilize the structured SOP step sequence, step calibration results, and frame-level device state features beyond video visual information, thereby more accurately identifying safety confirmation locations in standard operating procedures.
[0029] In terms of the proportion of low-quality keyframes and the efficiency of debriefing and localization, the proportion of low-quality keyframes in the method of this invention is 3.7%, significantly lower than the 8.1% of the general VideoMamba and the 10.4% of the CNN-LSTM summarization model; the average debriefing and localization time is reduced from 42.5 minutes with fixed-interval frame extraction to 12.9 minutes. This result shows that the environmental degradation correction in the scoring correction layer can reduce the selection of overexposed, blurred, occluded, and shaky frames as keyframes, and the risk node coverage verification can reduce the omission of key safety nodes, and the keyframe repetition rate is also reduced to 4.9%. Therefore, the keyframe set output by this invention can cover both standard operating procedures and reflect equipment status changes and risk node confirmation processes, making it more suitable for debriefing of standard operating procedures, safety audits, training assessments, and compliance checks in the aluminum industry.
[0030] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for extracting keyframes from standard work videos based on deep learning, characterized in that... It includes the following steps: S1. Acquire standard operation video, preprocess the standard operation video to obtain preprocessed video frame sequence and preprocessed audio data, read standard operation associated data in video frame sequence, and generate video frame timestamp based on standard operation associated data and video frame sequence acquisition time. Based on the video frame timestamps and standard operation association data, the preprocessed video frame sequence and preprocessed audio data are subjected to time correspondence and semantic association processing to form a time-corresponding video frame sequence, time-corresponding audio data and video-audio association data. Standard operation associated data, video frame timestamps, time-corresponding video frame sequences, time-corresponding audio data, and video-audio associated data together constitute the standard operation video record; S2. Read the standard operation associated data, call the corresponding standard operation file according to the standard operation file identifier, and generate the SOP structured step sequence; Read the video and audio association data from the standard operation video recording, determine the verbal identification data, match it with the structured step sequence of the SOP, and generate step calibration results; Read the video-related data in the standard operation video recording, identify the source identifier of the equipment status data, obtain the equipment status data, and generate frame-level equipment status features based on the video frame timestamp; S3. Input the standard operation video recording, SOP structured step sequence, step calibration results and frame-level device status features into the multi-source construction layer of the VideoMamba model to generate a multi-source token sequence and step boundary index for the operation; S4. Input the step boundary index and the job multi-source token into the segmented scanning layer of the VideoMamba model to generate a step boundary-aware temporal representation; S5. Input the step boundary-aware temporal representation and frame-level device state features into the risk scanning layer of the VideoMamba model to generate a risk scanning state representation. S6. Input the frame-level device state features into the mutation correction layer of the VideoMamba model to generate a mutation-enhanced state representation; S7. The mutation-enhanced state representation, step boundary-aware temporal representation, risk scanning state representation, and frame-level device state features are used as inputs to the scoring correction layer of the VideoMamba model to perform state fusion and environmental degradation correction, generating a set of standard operation video keyframes.
2. The method for extracting keyframes from standard work videos based on deep learning according to claim 1, characterized in that: The preprocessing process in step S1 includes the following steps: Acquire standard operation videos, which include video and audio streams; extract video frame sequences arranged according to acquisition time from the video stream; and perform frame rate unification, resolution unification, brightness equalization, and image stabilization processing on the video frame sequences. Noise reduction is performed on the audio stream; timestamp marking is performed on the video frame sequence and audio stream to obtain the preprocessed video frame sequence and preprocessed audio data; The standard operation associated data includes the task identifier, equipment identifier, standard operation document identifier, task start time, task end time, and equipment status data source identifier. The aforementioned equipment status data source identifier is used to indicate the data source for temperature, pressure, current, voltage, gas detection values, valve opening and closing status, equipment start-up and shutdown status, power failure status, and tag confirmation status.
3. The method for extracting keyframes from standard work videos based on deep learning according to claim 2, characterized in that: Step S1 specifically involves: performing frame rate unification using linear frame interpolation on the video frame sequence, resolution unification using bilinear interpolation, brightness equalization using contrast-limited adaptive histogram equalization, and image stabilization using ORB feature matching; performing noise reduction processing on the audio stream using spectral subtraction; and performing unified calibration based on the display timestamp of the video frame and the sampling timestamp of the audio sampling point to complete the timestamp calibration of the video frame sequence and the audio stream, thereby obtaining the preprocessed video frame sequence and the preprocessed audio data.
4. The method for extracting keyframes from standard operation videos based on deep learning according to claim 1, characterized in that, The S2 specifically includes the following steps: S21. Read the standard operation associated data, call the corresponding standard operation document according to the standard operation document identifier, write the step number, step name, operation object, action requirements, safety matters and risk nodes in the standard operation document into the structured step table, and generate the SOP structured step sequence according to the step number; the risk nodes correspond to high pressure confirmation, gas detection confirmation, power outage tag confirmation, protective equipment confirmation, valve status confirmation or electrolytic cell status confirmation. S22. Read the video and audio association data in the standard operation video recording, extract the corresponding audio segments according to the audio segment identifier and audio segment time range, and generate the oral segment text; match the oral segment text with the SOP structured step sequence to obtain the step number corresponding to each video frame, and generate the step calibration result. S23. Read the equipment status data source identifier in the standard operation associated data, obtain the equipment status data corresponding to the standard operation video record, align the numerical status and switch status in the equipment status data to the corresponding video frame according to the video frame timestamp, and generate the frame-level equipment status feature corresponding to each video frame; the numerical status includes temperature, pressure, current, voltage and gas detection value, and the switch status includes valve opening and closing status, equipment start and stop status, power off status and tag confirmation status.
5. The method for extracting keyframes from standard work videos based on deep learning according to claim 1, characterized in that, S3 specifically includes the following steps: S31. The multi-source construction layer of the VideoMamba model is based on the time-corresponding video frame sequence and video frame timestamp in the standard operation video recording. The YOLO object detection network is used to perform target region detection on each video frame to obtain equipment region image, instrument region image, hand action region image and tool region image. The above region images are respectively processed by ResNet convolutional neural network with the classification output layer removed to extract convolutional features. After convolution processing and global average pooling, the equipment region feature vector, instrument region feature vector, hand action region feature vector and tool region feature vector are obtained. The above four types of feature vectors are concatenated in sequence to obtain a fixed-dimensional frame visual token vector. The frame visual token vector corresponding to each video frame is arranged according to the video frame timestamp to generate a frame visual token sequence. The data structure of the frame visual token vector includes video frame identifier, video frame timestamp and frame visual feature vector. The frame visual feature vector is obtained by mapping the equipment region feature, instrument region feature, hand action region feature and tool region feature. S32. Read each work step record in the SOP structured step sequence. The work step record includes step number, step name, operation object, action requirements, safety matters and risk nodes. Perform step semantic encoding processing on the SOP structured step sequence to generate step semantic tokens. Arrange the step semantic tokens corresponding to each work step according to the step number to generate a step semantic token sequence. S33. Based on the step calibration results, the frame visual token sequence and the step semantic token sequence are aligned and spliced, and linear mapping and normalization processing are performed to generate the step alignment token vector corresponding to the video frame. The step alignment token vectors corresponding to all video frames are arranged according to the video frame timestamp to generate the step alignment token sequence. S34. Perform state feature encoding on the frame-level device state features to generate a device state token vector. Arrange the device state token vector corresponding to each video frame according to the video frame timestamp to generate a device state token sequence. S35. Using the video frame timestamp as the alignment reference, perform multi-source fusion encoding on the step alignment token sequence and the device status token sequence to obtain the job multi-source token vector. Arrange all job multi-source token vectors according to the video frame timestamp to generate the job multi-source token sequence. S36. Read the step number corresponding to each video frame in the step calibration result, and compare the step numbers of adjacent video frames frame by frame according to the video frame timestamp to divide the start and end positions of each operation step, and generate a step boundary index based on the start and end positions of each operation step.
6. The method for extracting keyframes from standard work videos based on deep learning according to claim 1, characterized in that, The S4 specifically includes the following steps: S41. Input the step boundary index and the multi-source token sequence of the job into the segmented scanning layer of the VideoMamba model; the segmented scanning layer of the VideoMamba model includes a subsequence partitioning unit, a bidirectional scanning unit, a gated transfer unit, and a timing representation output unit. S42. The subsequence partitioning unit reads the multi-source token sequence and step boundary index of the operation, and divides the multi-source token vectors of the operation that are located between the start and end positions of the same operation step into the same step subsequence; the step subsequence can correspond to any one of the standard operation steps such as valve closing confirmation, gas detection confirmation, power failure tagging confirmation, electrolytic cell status confirmation and protective equipment confirmation. S43. The bidirectional scanning unit performs a bidirectional selective state space scan on the multi-source token vector of each step subsequence to obtain the forward step scan state and the reverse step scan state, and combines the forward step scan state and the reverse step scan state to generate the in-step scan state. S44. Input the intra-step scanning state corresponding to the adjacent step sub-sequence into the gated transfer unit, generate the step transfer weight, and use the step transfer weight to perform gated transfer processing on the scanning state between adjacent step sub-sequences to generate cross-step transfer state. Write the cross-step transfer state into the step scan state corresponding to the starting token of the next SOP step to generate the cross-step scan state. S45. The timing representation output unit fuses the intra-step scan state and the cross-step scan state to generate a step boundary-aware timing representation.
7. The method for extracting keyframes from standard work videos based on deep learning according to claim 1, characterized in that, The S5 specifically includes the following steps: S51. Input the step boundary-aware timing representation and frame-level device state features into the risk scanning layer. The risk scanning layer includes a state change evaluation unit, a risk gating weight generation unit, a risk weighted scanning unit, and a scanning state output unit. S52. In the risk scanning layer, the state change evaluation unit reads the device numerical state and device on / off state from the frame-level device state characteristics and generates the device numerical change evaluation quantity and the device on / off change evaluation quantity. S53. Input the step boundary perception timing representation, equipment numerical change evaluation quantity and equipment switching change evaluation quantity into the risk gating weight generation unit, perform risk gating fusion coding processing, and generate risk gating weights. S54. The risk-weighted scanning unit reads each time-series vector in the step boundary perception time-series representation according to the video frame timestamp order, and uses the risk gating weight to adjust the corresponding dimensions of the current time-series vector and the previous risk scanning state to generate the current risk scanning state. S55. In the scanning status output unit, the current risk scanning status corresponding to each video frame is bound to the corresponding video frame timestamp, and a risk scanning status representation is generated according to the video frame timestamps.
8. The method for extracting keyframes from standard operation videos based on deep learning according to claim 1, characterized in that, The S6 specifically includes the following steps: S61. Input the frame-level device status features and risk scan status representation into the mutation correction layer; read the device value status corresponding to the adjacent video frame, subtract the values of the current video frame from the previous video frame in each device value field and take the absolute value to obtain the original value mutation amount. The original numerical mutation amount is normalized according to the allowable value range of each device numerical field to obtain the device numerical mutation evaluation vector; the device switch status corresponding to the adjacent video frame is read, and the status of the current video frame and the previous video frame in each device switch field is XORed and compared. When the status of the same field changes, the field takes the value of 1, and when the status of the same field does not change, the field takes the value of 0 to obtain the device switch mutation evaluation vector. S62. Convert the equipment numerical mutation evaluation vector and the equipment switch mutation evaluation vector into mutation sub-vectors of the same dimension. Perform splicing and normalization processing on the two types of mutation sub-vectors to obtain the mutation fusion vector. Calculate the average value of each dimension of the mutation fusion vector to obtain the equipment status mutation evaluation value corresponding to the video frame. S63. Read the equipment state change evaluation values corresponding to all video frames in the same operation step, calculate their average value and standard deviation, add the average value and standard deviation to obtain the change judgment value in the step, and when the equipment state change evaluation value corresponding to a certain video frame is greater than the change judgment value in the step, the video frame is determined as the equipment state change point. S64. Read the risk scan status corresponding to the equipment status mutation point in the risk scan status representation, normalize the equipment status mutation evaluation value to the range of 0 to 1 to obtain the mutation enhancement coefficient; multiply the risk scan status vector with the mutation enhancement coefficient dimension by dimension to obtain the mutation enhancement component, and add the risk scan status vector with the mutation enhancement component dimension by dimension to obtain the mutation point enhancement status vector. S65. Write the mutation point enhancement state vector into the video frame position corresponding to the device state mutation point. For video frames that are not corresponding to mutation points, retain the risk scan state vector corresponding to the video frame. Arrange the mutation point enhancement state vector and the risk scan state vector that are not corresponding to mutation points according to the video frame timestamp to obtain the mutation enhancement state representation.
9. The method for extracting keyframes from standard work videos based on deep learning according to claim 1, characterized in that, The S7 specifically includes the following steps: S71. Input the mutation enhancement state representation and standard operation video recording into the scoring correction layer. Read the mutation enhancement state representation, step boundary awareness temporal representation, risk scan state representation, and frame-level device state features. Perform mean normalization on the step boundary awareness temporal representation corresponding to the current video frame to obtain the step state sub-vector. Perform maximum value normalization on the risk scan state representation corresponding to the current video frame to obtain the risk state sub-vector. Perform mean normalization on the mutation enhancement state representation corresponding to the current video frame to obtain the mutation state sub-vector. Calculate the difference and compare the state changes between the frame-level device state features corresponding to the current video frame and the frame-level device state features corresponding to the previous video frame to generate the device change sub-vector. Concatenate the step state sub-vector, risk state sub-vector, mutation state sub-vector, and device change sub-vector in sequence to generate a fused combination vector. Perform feature compression and normalization on the fused combination vector to generate a fused state representation. S72. Read the video frame sequence corresponding to the time in the standard operation video record, and calculate the brightness degradation, sharpness degradation, occlusion degradation and stability degradation for the current video frame; The generation of brightness degradation amount involves counting the number of overly bright pixels and overly dark pixels in the current video frame, adding the number of overly bright pixels to the number of overly dark pixels, and then dividing by the total number of pixels in the current video frame to obtain the brightness degradation amount. The generation of sharpness degradation includes performing Sobel edge gradient calculation on the current video frame to obtain the mean edge gradient, normalizing the mean edge gradient, and subtracting the normalized result from 1 to obtain the sharpness degradation amount. The generation of occlusion degradation includes reading the device area, instrument area, hand gesture area, and tool area in the current video frame, calculating the ratio of the sum of the areas of occluded areas in these areas to the total area of these areas, and obtaining the occlusion degradation amount. The generation of stable degradation includes calculating the image displacement between the current video frame and the previous video frame, dividing the image displacement by the diagonal length of the video frame, and obtaining the stable degradation amount. The brightness degradation amount, sharpness degradation amount, occlusion degradation amount, and stable degradation amount are then ordered in the following order: The process involves generating an environmental degradation evaluation vector, reading the environmental degradation evaluation vector, adding the brightness degradation, occlusion degradation, and stability degradation, and then dividing by three to obtain the visual interference. The sharpness degradation is used as the sharpness loss. The visual interference and sharpness loss are concatenated to generate a degradation combination vector. A linear mapping is applied to the degradation combination vector to generate a degradation correction vector with the same dimensions as the fusion state representation. The Sigmoid function is used to perform interval compression on the degradation correction vector, ensuring that each dimension of the degradation correction vector takes values between 0 and 1. The degradation correction vector is subtracted from 1 to obtain the effective retention vector. The fusion state representation is multiplied by the effective retention vector according to their corresponding dimensions to obtain the corrected state representation. S73. Based on the corrected state vector corresponding to each video frame in the corrected state representation, divide it into step response segment, risk response segment, mutation response segment, and visually effective response segment according to the fixed dimension order of the corrected state vector; calculate the average value of each dimension value in the step response segment, risk response segment, mutation response segment, and visually effective response segment to obtain the step completion score, risk node score, equipment mutation score, and visually effective score; perform weighted summation of the step completion score, risk node score, equipment mutation score, and visually effective score to obtain the original score of a single frame; perform maximum and minimum normalization processing on the original scores of the single frames corresponding to all video frames in the same standard operation video to generate the key frame importance score corresponding to each video frame. S74. Based on the keyframe importance score, select candidate keyframes within the video frame range corresponding to each SOP structured step sequence. Within the video frame range corresponding to each SOP step, sort the video frames in descending order of keyframe importance score, and select video frames sequentially according to the minimum time interval between adjacent keyframes to generate a candidate keyframe set. Read the risk nodes in the SOP structured step sequence, and determine the video frame range corresponding to each risk node based on the step calibration results. Check whether there are candidate keyframes in the candidate keyframe set that are located within the video frame range corresponding to each risk node, and generate risk node coverage results. When a certain risk node is not covered, within the video frame range corresponding to the risk node, the video frame that meets the picture quality conditions and has the highest key frame importance score is determined as the supplementary key frame. The candidate key frame set and the supplementary key frame are sorted according to the video frame timestamp to generate the standard operation video key frame set.
