Video frame stream processing method and system

By detecting and analyzing the video frame stream through the CNN-LSTM model, combined with AES encryption and identity authentication, the problem of security threats during video transmission is solved, and efficient security protection of the video frame stream is achieved.

CN118540515AInactive Publication Date: 2024-08-23GUANGXI FUPENG CULTURAL DEV CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410760158.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-08-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

During the video transmission process, there are security threats such as data leakage, tampering, and interception, and it is difficult for existing technologies to effectively identify and respond to these threats.

Method used

The CNN-LSTM combined model is used to detect and analyze the video frame stream in real time, which is divided into key frames and non-key frames. The AES symmetric encryption algorithm and partial encryption method are used for encrypted transmission respectively, and a feedback mechanism is established to deal with security threats. At the same time, Authentication before transfer.

Benefits of technology

Effectively identify security threats in video frame streams, reduce the impact of the encryption process on bandwidth and performance, and improve security threat response capabilities and transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540515A
    Figure CN118540515A
Patent Text Reader

Abstract

The invention discloses a video frame stream processing method and system, and belongs to the field of multimedia security. The video frame stream processing method comprises the following steps: dividing a video frame stream into a key frame and a non-key frame; performing real-time detection and analysis on a video frame stream by using a CNN-LSTM combination model, identifying possible security threats, and detecting abnormal changes in an image; in the transmission process, establishing a feedback mechanism, and performing corresponding feedback and processing according to a result output by the CNN-LSTM model; an AES symmetric encryption algorithm and a partial encryption mode are respectively adopted to carry out end-to-end encryption transmission on the key frame and the non-key frame; identity authentication is performed before transmission is started. Image features are extracted through CNN, time sequence information is modeled through LSTM, training is carried out in combination with a linear function and a loss function, and security threats and abnormal changes in video frame images are effectively recognized; and a feedback mechanism is established, and corresponding feedback and processing are carried out according to a result output by the CNN-LSTM model, so that the capability of coping with security threats is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of multimedia security, and in particular relates to a video frame stream processing method and a system thereof. Background Art

[0002] With the continuous development of computer technology and network technology, users can not only watch video files stored in their own terminal devices, but also watch video files on the network side. The video server on the network side stores video files that can be transmitted to users. When users want to watch video files stored in the video server on the network side, they can send a video transmission request to the video server through the terminal device they use. After receiving the video transmission request, the video server transmits the corresponding video file to the terminal device, and the terminal device plays the received video file. A video file consists of a series of ordered video frames (i.e., a single static picture), so a video file can also be called a video frame stream.

[0003] However, during the video transmission process, there may be security threats, such as data leakage, tampering or interception, etc. Therefore, appropriate security measures need to be taken during the video transmission process, and a video frame stream processing method is proposed for this purpose. Summary of the invention

[0004] In view of the deficiencies in the prior art, the purpose of the present invention is to provide a video frame stream processing method and system thereof, which solves the problems in the prior art.

[0005] The purpose of the present invention can be achieved through the following technical solutions:

[0006] A video frame stream processing method comprises the following steps:

[0007] Divide the video frame stream into key frames and non-key frames;

[0008] Use the CNN-LSTM combined model to perform real-time detection and analysis of video frame streams, identify possible security threats, and detect abnormal changes in images;

[0009] During the transmission process, a feedback mechanism is established to provide corresponding feedback and processing based on the output results of the CNN-LSTM model;

[0010] AES symmetric encryption algorithm and partial encryption are used to perform end-to-end encrypted transmission of key frames and non-key frames respectively;

[0011] Authentication is performed before the transmission begins.

[0012] Furthermore, the CNN-LSTM combined model includes:

[0013] Convolutional layer: used to extract features from images;

[0014] Pooling layer: used to reduce the size of feature maps and the number of parameters while retaining key information;

[0015] Stacking of convolution-pooling layers: used to gradually extract and abstract image features;

[0016] Flatten layer: Flattens the feature map output by the convolutional layer into a one-dimensional vector as the input of the LSTM layer;

[0017] LSTM layer: used to model the temporal information in the image sequence and capture the temporal correlation between image frames;

[0018] Hidden layers: used to increase the depth and complexity of the network;

[0019] Output layer: Connect the output of the LSTM layer to the fully connected layer and finally output the prediction results of the model.

[0020] Furthermore, the linear function of the CNN-LSTM combined model is:

[0021]

[0022] In the formula, z j is the weighted sum of the inputs of the jth neuron in the fully connected layer, w ij is the weight connecting the i-th input feature and the j-th neuron, x i is the i-th element of the input feature vector, b j is the bias term of the jth neuron, N is the dimension of the input feature vector;

[0023] The loss function of the CNN-LSTM combined model is:

[0024]

[0025] In the formula, Represents the difference between the predicted result output by the model and the true label; ij Represents the label value of the jth category in the true label of sample i; Represents the predicted probability of the jth category in the model output for sample i.

[0026] Furthermore, the specific steps of using the CNN-LSTM combined model to perform real-time detection and analysis of video frame streams include:

[0027] S21, preprocessing the collected video frames, including image size adjustment and normalization operations;

[0028] S22, using the preprocessed video frames, through repeated iterative training and verification, adjust the structure and hyperparameters of the CNN-LSTM combination model, and optimize the CNN-LSTM combination model;

[0029] S23, the frequency frames are input into the trained and tuned CNN-LSTM model, and the model performs real-time analysis and monitoring on each frame to detect abnormal changes, object occlusions, scene changes in the image, and identify security threats.

[0030] Furthermore, the steps of optimizing the CNN-LSTM combined model include:

[0031] S221, dividing the data set into a training set, a validation set and a test set; the training set is used for parameter training of the model, the validation set is used for hyperparameter adjustment and performance evaluation of the model, and the test set is used for performance evaluation of the final model;

[0032] S222, training the deep learning model using the training set. During the training process, the parameters of the model are updated through a back propagation algorithm and an optimizer so that the loss function of the model gradually decreases.

[0033] S223, using the validation set to evaluate the trained model, and adjusting the hyperparameters of the model according to the performance of the validation set, the hyperparameters including: learning rate, batch size, network structure, and regularization parameters;

[0034] S224, monitor the performance of the model on the validation set, and stop training when the performance no longer improves.

[0035] Furthermore, when encrypting non-key frames, only sensitive areas are encrypted.

[0036] A video frame stream processing system, comprising:

[0037] Classification module: divides the video frame stream into key frames and non-key frames;

[0038] Detection and analysis module: Uses the CNN-LSTM combined model to perform real-time detection and analysis of video frame streams, identify possible security threats, and detect abnormal changes in images;

[0039] Transmission feedback module: During the transmission process, a feedback mechanism is established to provide corresponding feedback and processing based on the output results of the CNN-LSTM model;

[0040] Transmission encryption module: AES symmetric encryption algorithm and partial encryption are used to perform end-to-end encrypted transmission of key frames and non-key frames respectively;

[0041] And, the identity authentication module: performs identity authentication before the transmission begins.

[0042] A computer storage medium stores a readable program, and when the program is run, the above-mentioned video frame stream processing method can be executed.

[0043] An electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus;

[0044] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the above-mentioned video frame stream processing method.

[0045] A computer program product includes computer instructions, wherein the computer instructions instruct a computing device to execute operations corresponding to the above-mentioned video frame stream processing method.

[0046] Beneficial effects of the present invention:

[0047] 1. The present invention divides the video frame stream into key frames and non-key frames, and adopts different encryption methods to encrypt the key frames and non-key frames respectively, wherein the non-key frames are encrypted by partial encryption (only sensitive areas are encrypted) to reduce the impact of the encryption process on bandwidth and performance, while reducing overhead.

[0048] 2. The CNN-LSTM combined model is used to detect and analyze video frame streams, and the CNN in the model is used to extract image features. The LSTM modeling time series information is combined with linear functions and loss functions for training, which can effectively identify security threats and abnormal changes in video frame images.

[0049] 3. By establishing a feedback mechanism, corresponding feedback and processing are carried out according to the output results of the CNN-LSTM model to improve the ability to respond to security threats. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0051] Figure 1 It is a flow chart of the video frame stream processing method of the present invention. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] like Figure 1 As shown, a video frame stream processing method comprises the following steps:

[0054] S1, before transmission, divide the video frame stream into key frames (I frames) and non-key frames (P frames, B frames);

[0055] Key frames contain complete image information, while non-key frames usually only contain partial image information. By classifying frames, different security processing can be performed on key frames and non-key frames in a targeted manner, thereby more efficiently protecting the security of video content.

[0056] At the same time, since key frames have higher image quality and importance, security processing such as encryption, transmission and storage of key frames may require more resources and computing costs. Security processing of non-key frames can be more lightweight, saving resources and bandwidth. By rationally utilizing resources, the overall performance and efficiency of the system can be improved.

[0057] The steps of video frame stream classification specifically include:

[0058] S11, extracting frames: First, extracting image data of each frame from the video frame stream.

[0059] S12, frame type identification: perform type identification on each extracted frame to determine which type of frame it belongs to. In common video coding standards, frames are usually divided into the following types:

[0060] Key frame (I frame): A key frame is an important frame in a video sequence. It contains complete image information and does not depend on the data of other frames. Usually, a key frame appears once every several frames to save the reference image of the video. Subsequent frames are changes relative to the key frame. You can determine whether a frame is a key frame by checking the frame header information or a specific flag.

[0061] Non-key frames (P frames, B frames): Non-key frames are encoded based on data from other frames, and usually only store the difference with the previous frame or multiple frames before and after. In video coding standards such as H.264, non-key frames are usually divided into two types: predicted frames (P frames) and bidirectional predicted frames (B frames). P frames rely on the data of the previous frame for encoding, while B frames rely on the data of both the previous and next frames. Therefore, B frames usually have a higher compression rate, but are also more complex.

[0062] S13, frame classification: classify each frame according to the type of the frame, and classify each frame as a key frame or a non-key frame.

[0063] S14, marking frames: marking each frame to indicate the frame type it belongs to.

[0064] S2 uses the CNN-LSTM combined model to detect and analyze video frame streams in real time to identify possible security threats, such as data tampering and malicious attacks; and detect abnormal changes in images, such as object occlusion and scene changes, thereby improving the security monitoring capabilities of video content;

[0065] The specific steps include:

[0066] S21, preprocessing the collected video frames, including image resizing and normalization operations, to ensure that the input data matches the requirements of the training model;

[0067] S22, using the preprocessed video frames, through repeated iterative training and verification, adjust the structure and hyperparameters of the CNN-LSTM combination model, and optimize the performance of the CNN-LSTM combination model to improve the accuracy and generalization ability of the model;

[0068] The CNN-LSTM combined model includes:

[0069] Convolutional layer: used to extract features from images, including low-level features such as edges and textures and high-level features such as objects and scenes;

[0070] Pooling layer: used to reduce the size of feature maps and the number of parameters while retaining key information;

[0071] Convolution-Pooling Layer Stacking: There are multiple convolution-pooling layers stacked to gradually extract and abstract image features;

[0072] Flatten layer: Flattens the feature map output by the convolutional layer into a one-dimensional vector as the input of the LSTM layer;

[0073] LSTM layer: used to model the temporal information in the image sequence and capture the temporal correlation between image frames;

[0074] Hidden layer: There are multiple LSTM layers stacked to increase the depth and complexity of the network;

[0075] Output layer: Connect the output of the LSTM layer to the fully connected layer and finally output the prediction results of the model.

[0076] In the linear function of the CNN-LSTM combination model, the output layer of the CNN-LSTM combination model is connected to the fully connected layer and the activation function (ReLU) is used for nonlinear transformation. The output of the fully connected layer is classified by the softmax function and the probability of each category is output. The linear function of the CNN-LSTM combination model is:

[0077]

[0078] In the formula, z j is the weighted sum of the inputs of the jth neuron in the fully connected layer, w ij is the weight connecting the i-th input feature and the j-th neuron, x i is the i-th element of the input feature vector, b j is the bias term of the jth neuron, N is the dimension of the input feature vector;

[0079] Based on this linear function, the nonlinear transformation is performed through the activation function ReLU to obtain the output of the neuron

[0080]

[0081] In the formula, f(z j ) activation function;

[0082] The probability p of category j is calculated by the softmax function j :

[0083]

[0084] Where K is the number of output categories.

[0085] The CNN-LSTM combination model uses the cross-entropy loss function to measure the difference between the prediction results output by the model and the true label; its expression is:

[0086]

[0087] In the formula, Represents the difference between the predicted result output by the model and the true label; ij Represents the label value of the jth category in the true label of sample i (1 means it belongs to this category, 0 means it does not belong to this category); Represents the predicted probability of the jth category in the model output for sample i.

[0088] By extracting image features through CNN, modeling time series information through LSTM, and combining linear functions and loss functions for training, security threats and abnormal changes in video frame images can be effectively identified.

[0089] The steps to optimize the CNN-LSTM combined model include:

[0090] S221, divide the data set into a training set, a validation set and a test set; the training set is used for parameter training of the model, the validation set is used for hyperparameter adjustment and performance evaluation of the model, and the test set is used for performance evaluation of the final model.

[0091] S222, training the deep learning model using the training set. During the training process, the parameters of the model are updated through the back propagation algorithm and the optimizer (Adam), so that the loss function of the model is gradually reduced;

[0092] S223, use the validation set to evaluate the trained model, and adjust the model's hyperparameters according to the performance of the validation set. The hyperparameters include: learning rate: controls the step size of parameter updates. A learning rate that is too large may cause model oscillation, while a learning rate that is too small may cause slow convergence.

[0093] Batch size: The number of samples used in each training iteration, which affects the convergence speed and generalization ability of the model.

[0094] Network structure: including the number of network layers, the number of neurons in each layer, the size of the convolution kernel, etc.

[0095] Regularization parameters: such as the weights of L1 regularization and L2 regularization.

[0096] S224, monitor the performance of the model on the validation set. When the performance no longer improves, stop training to prevent overfitting. If the data set is small, cross-validation can be used to evaluate the generalization ability of the model to further improve the robustness of the model.

[0097] By repeatedly iteratively training and validating, and adjusting the model's hyperparameters and structure, the performance of the deep learning model can be gradually optimized, and its accuracy and generalization ability can be improved.

[0098] S23, the video frame is input into the trained and optimized CNN-LSTM model, and each frame is analyzed and monitored in real time through the model; the model can detect abnormal changes, object occlusion, scene changes, etc. in the image, and identify possible security threats.

[0099] S3, during the transmission process, a feedback mechanism is established to perform corresponding feedback and processing according to the output results of the CNN-LSTM model.

[0100] If an abnormal situation is detected, timely measures will be taken to respond, such as triggering an alarm, taking preventive measures, or automatically adjusting security policies to deal with potential security threats; by continuously iterating and improving the feedback mechanism, the ability to respond to security threats and the transmission efficiency will be improved.

[0101] S4 uses AES symmetric encryption algorithm and partial encryption to perform end-to-end encrypted transmission of video key frames and non-key frames respectively to ensure data security during transmission; at the same time, it ensures the secure transmission and management of keys to prevent data leakage and tampering.

[0102] The steps of using the AES symmetric encryption algorithm to perform end-to-end encrypted transmission of video key frames include:

[0103] 1) Key generation: The sender and receiver negotiate the key and use a secure key negotiation protocol to generate a shared key.

[0104] 2) Encrypted key frame: The sender uses a shared key to encrypt the key frame to protect its content; the AES (Advanced Encryption Standard) symmetric encryption algorithm is used to encrypt the key frame.

[0105] 3) Transmit encrypted data: The sender transmits the encrypted key frame to the receiver to ensure data security during the transmission process.

[0106] 4) Decrypting the received data: The receiver uses the same shared key to decrypt the received encrypted data and restore the original key frame content.

[0107] The steps of using partial encryption to perform end-to-end encrypted transmission of non-key frames of a video include:

[0108] 1) Key generation: The sender and receiver still negotiate the key and generate a shared key.

[0109] 2) Encrypt non-key frames: Unlike key frames, non-key frames can usually be encrypted more lightly because their content is not as important as key frames; they can be encrypted using partial encryption (encrypting only sensitive areas) to reduce the impact of the encryption process on bandwidth and performance.

[0110] 3) Transmit encrypted data: The sender transmits the encrypted non-key frames to the receiver to ensure data security during the transmission process.

[0111] 4) Decrypting the received data: The receiver uses the same shared key to decrypt the received encrypted data and restore the original non-key frame content.

[0112] It is worth mentioning that encryption of key frames usually introduces greater performance overhead because their content is more important and requires stricter protection. Encryption of non-key frames can use a lighter encryption algorithm to reduce the impact of the encryption process on transmission performance.

[0113] S5, identity authentication is performed before the transmission begins to ensure that both parties of the transmission are legal and trustworthy; digital certificates, token authentication, etc. can be used to authenticate the transmission party to prevent unauthorized access and malicious attacks.

[0114] The method of the present invention may be implemented in hardware, firmware, or as software or computer code that may be stored in a recording medium (such as a CDROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code that is originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded over a network and will be stored in a local recording medium, so that the method described herein may be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that a computer, processor, microprocessor controller, or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, processor, or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the method shown herein.

[0115] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements all fall within the scope of the present invention to be protected.

Claims

1. A video frame stream processing method, characterized in that: The following steps are involved: Divide the video frame stream into key frames and non-key frames; Use the CNN-LSTM combined model to perform real-time detection and analysis of video frame streams, identify possible security threats, and detect abnormal changes in images; During the transmission process, a feedback mechanism is established to provide corresponding feedback and processing based on the output results of the CNN-LSTM model; AES symmetric encryption algorithm and partial encryption are used to perform end-to-end encrypted transmission of key frames and non-key frames respectively; Authentication is performed before the transmission begins.

2. A video frame stream processing method according to claim 1, characterized in that: The CNN-LSTM combined model includes: Convolutional layer: used to extract features from images; Pooling layer: used to reduce the size of feature maps and the number of parameters while retaining key information; Stacking of convolution-pooling layers: used to gradually extract and abstract image features; Flatten layer: Flattens the feature map output by the convolutional layer into a one-dimensional vector as the input of the LSTM layer; LSTM layer: used to model the temporal information in the image sequence and capture the temporal correlation between image frames; Hidden layers: used to increase the depth and complexity of the network; Output layer: Connect the output of the LSTM layer to the fully connected layer and finally output the prediction results of the model.

3. A video frame stream processing method according to claim 2, characterized in that: The linear function of the CNN-LSTM combined model is: In the formula, z j is the weighted sum of the inputs of the jth neuron in the fully connected layer, w ij is the weight connecting the i-th input feature and the j-th neuron, x i is the i-th element of the input feature vector, b j is the bias term of the jth neuron, N is the dimension of the input feature vector; The loss function of the CNN-LSTM combined model is: In the formula, Represents the difference between the predicted result output by the model and the true label; ij Represents the label value of the jth category in the true label of sample i; Represents the predicted probability of the jth category in the model output for sample i.

4. A video frame stream processing method according to claim 2, characterized in that: The specific steps of using the CNN-LSTM combined model to perform real-time detection and analysis of video frame streams include: S21, preprocessing the collected video frames, including image size adjustment and normalization operations; S22, using the preprocessed video frames, through repeated iterative training and verification, adjust the structure and hyperparameters of the CNN-LSTM combination model, and optimize the CNN-LSTM combination model; S23, the frequency frames are input into the trained and tuned CNN-LSTM model, and the model performs real-time analysis and monitoring on each frame to detect abnormal changes, object occlusions, scene changes in the image, and identify security threats.

5. A video frame stream processing method according to claim 4, characterized in that: The steps to optimize the CNN-LSTM combined model include: S221, dividing the data set into a training set, a validation set and a test set; the training set is used for parameter training of the model, the validation set is used for hyperparameter adjustment and performance evaluation of the model, and the test set is used for performance evaluation of the final model; S222, training the deep learning model using the training set. During the training process, the parameters of the model are updated through a back propagation algorithm and an optimizer so that the loss function of the model gradually decreases. S223, using the validation set to evaluate the trained model, and adjusting the hyperparameters of the model according to the performance of the validation set, the hyperparameters including: learning rate, batch size, network structure, and regularization parameters; S224, monitor the performance of the model on the validation set, and stop training when the performance no longer improves.

6. A video frame stream processing method according to claim 1, characterized in that: When encrypting non-keyframes, only sensitive areas are encrypted.

7. A video frame stream processing system, characterized in that: include: Classification module: divides the video frame stream into key frames and non-key frames; Detection and analysis module: Uses the CNN-LSTM combined model to perform real-time detection and analysis of video frame streams, identify possible security threats, and detect abnormal changes in images; Transmission feedback module: During the transmission process, a feedback mechanism is established to provide corresponding feedback and processing based on the output results of the CNN-LSTM model; Transmission encryption module: AES symmetric encryption algorithm and partial encryption are used to perform end-to-end encrypted transmission of key frames and non-key frames respectively; And, the identity authentication module: performs identity authentication before the transmission begins.

8. A computer storage medium storing a readable program, characterized in that: When the program is running, it can execute the video frame stream processing method described in any one of claims 1 to 6.

9. An electronic device, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to a video frame stream processing method as described in any one of claims 1-6.

10. A computer program product, comprising computer instructions, wherein the computer instructions instruct a computing device to execute operations corresponding to a video frame stream processing method as claimed in any one of claims 1 to 6.

Citation Information

Cited By

  • Intelligent analysis method and system for realizing video stream based on neural network

    CN119723426A

  • Intelligent Analysis Method and System for Video Streams Based on Neural Networks

    CN119723426B