CN111898573A - Image prediction method, computer device, and storage medium - Google Patents

Image prediction method, computer device, and storage medium Download PDF

Info

Publication number
CN111898573A
CN111898573A CN202010778638.3A CN202010778638A CN111898573A CN 111898573 A CN111898573 A CN 111898573A CN 202010778638 A CN202010778638 A CN 202010778638A CN 111898573 A CN111898573 A CN 111898573A
Authority
CN
China
Prior art keywords
image
optical flow
historical
training
frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010778638.3A
Other languages
Chinese (zh)
Inventor
郜杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Eye Control Technology Co Ltd
Original Assignee
Shanghai Eye Control Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Eye Control Technology Co Ltd filed Critical Shanghai Eye Control Technology Co Ltd
Priority to CN202010778638.3A priority Critical patent/CN111898573A/en
Publication of CN111898573A publication Critical patent/CN111898573A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/41Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
    • G06V20/42Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items of sport video content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/46Extracting features or characteristics from the video content, e.g. video fingerprints, representative shots or key frames

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The present application relates to an image prediction method, a computer device, and a storage medium. The method comprises the following steps: acquiring a historical image set; the historical image set comprises N frames of historical images which are continuous in time, wherein N is a positive integer greater than 1; determining optical flow change information of the N frames of historical images; the optical flow change information is used for representing optical flow change characteristics between every two frames of historical images; and predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to a prediction result and a preset frame historical image in the historical image set. By adopting the method, the prediction accuracy can be improved.

Description

Image prediction method, computer device, and storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image prediction method, a computer device, and a storage medium.
Background
With the development of computer technology and image processing technology, image prediction technology has emerged. For example, the movement trajectory of the human body or the object is predicted based on the historical image. The image prediction technology can be applied to the fields of automatic driving, weather prediction and the like, and great convenience is provided for the work and life of people.
In the related art, the image prediction technology generally uses an optical flow method to perform extrapolation to obtain a predicted image. However, this method has a problem of inaccurate prediction.
Disclosure of Invention
In view of the above, it is necessary to provide an image prediction method, a computer device, and a storage medium capable of improving prediction accuracy in view of the above technical problems.
A method of image prediction, the method comprising:
acquiring a historical image set; the historical image set comprises N frames of historical images which are continuous in time, wherein N is a positive integer greater than 1;
determining optical flow change information of the N frames of historical images; the optical flow change information is used for representing optical flow change characteristics between every two frames of historical images;
and predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to a prediction result and a preset frame historical image in the historical image set.
In one embodiment, the determining optical flow variation information of the N frames of history images includes:
inputting the N frames of historical images into a preset optical flow calculation model to obtain optical flow change information output by the optical flow calculation model; the optical flow change information comprises an N-1 frame historical optical flow feature map.
In one embodiment, the above inputting the N frames of history images into a preset optical flow calculation model to obtain optical flow change information output by the optical flow calculation model includes:
taking every two frames of historical images in the historical image set as an image pair to obtain N-1 image pairs;
and sequentially inputting the N-1 image pairs into the optical flow calculation model according to the sequence to obtain the N-1 frame historical optical flow characteristic diagram sequentially output by the optical flow calculation model.
In one embodiment, the predicting the optical flow variation information by using a pre-trained target neural network and obtaining a predicted image according to the prediction result and a preset frame history image in a history image set includes:
inputting the N-1 frame historical optical flow characteristic graph into a target neural network for prediction to obtain a predicted optical flow characteristic graph output by the target neural network;
and carrying out deformation processing on the preset frame historical image in the historical image set according to the predicted optical flow characteristic diagram to obtain a predicted image.
In one embodiment, the above transforming a preset frame history image in the history image set according to the predicted optical flow feature map to obtain a predicted image includes:
calculating the target migration position of each pixel point in the historical image of the preset frame according to the predicted optical flow characteristic diagram;
and generating a predicted image according to the target migration position of each pixel point and the pixel value of each pixel point.
In one embodiment, the training process of the target neural network includes:
acquiring a training image set; the training image set comprises N +1 continuous training images, the first N training images are training samples, and the (N + 1) th training image is a label;
and training the neural network based on the training image set to obtain the target neural network.
In one embodiment, the training of the neural network based on the training image set to obtain the target neural network includes:
inputting the previous N frames of training images into a preset optical flow calculation model to obtain an N-1 frame of training optical flow characteristic diagram;
inputting the N-1 frame training optical flow characteristic diagram into an initial neural network to obtain an Nth frame training optical flow characteristic diagram;
carrying out deformation processing on a preset frame training image according to the N frame training optical flow characteristic diagram to obtain a deformation image;
and calculating the deformation image and the label by using a loss function to obtain a loss value, and adjusting the adjustable parameters in the initial neural network according to the loss value until the loss value meets a convergence condition to obtain the target neural network.
In one embodiment, after the obtaining the predicted image, the method further comprises:
updating the historical image set according to the predicted image;
and repeatedly executing the steps of determining optical flow change information among the N frames of historical images, predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to the prediction result and the preset frame historical images in the historical image set to obtain a video image in a future period.
An image prediction apparatus, the apparatus comprising:
the historical image set acquisition module is used for acquiring a historical image set; the historical image set comprises N frames of historical images which are continuous in time, wherein N is a positive integer greater than 1;
the optical flow determining module is used for determining optical flow change information of the N frames of historical images; the optical flow change information is used for representing optical flow change characteristics between every two frames of historical images;
and the prediction module is used for predicting the optical flow change information by utilizing a pre-trained target neural network and obtaining a predicted image according to a prediction result and a preset frame historical image in the historical image set.
In one embodiment, the optical flow determining module is specifically configured to input the N frames of historical images into a preset optical flow calculation model to obtain optical flow change information output by the optical flow calculation model; the optical flow change information comprises an N-1 frame historical optical flow feature map.
In one embodiment, the optical flow determining module is specifically configured to use every two frames of historical images in the historical image set as one image pair to obtain N-1 image pairs; and sequentially inputting the N-1 image pairs into the optical flow calculation model according to the sequence to obtain the N-1 frame historical optical flow characteristic diagram sequentially output by the optical flow calculation model.
In one embodiment, the prediction module includes:
the prediction sub-module is used for inputting the historical optical flow characteristic diagram of the N-1 frame into a target neural network for prediction to obtain a predicted optical flow characteristic diagram output by the target neural network;
and the image obtaining submodule is used for carrying out deformation processing on the preset frame historical image in the historical image set according to the predicted optical flow characteristic diagram to obtain a predicted image.
In one embodiment, the image obtaining submodule is specifically configured to calculate a target migration position of each pixel point in a preset frame history image according to the predicted optical flow feature map; and generating a predicted image according to the target migration position of each pixel point and the pixel value of each pixel point.
In one embodiment, the apparatus further comprises:
the training image set acquisition module is used for acquiring a training image set; the training image set comprises N +1 continuous training images, the first N training images are training samples, and the (N + 1) th training image is a label;
and the training module is used for training the neural network based on the training image set to obtain the target neural network.
In one embodiment, the training module is specifically configured to input the previous N frames of training images into a preset optical flow calculation model to obtain an N-1 frame of training optical flow feature map; inputting the N-1 frame training optical flow characteristic diagram into an initial neural network to obtain an Nth frame training optical flow characteristic diagram; carrying out deformation processing on the N frame of training image according to the N frame of training optical flow characteristic diagram to obtain a deformation image; and calculating the deformation image and the label by using a loss function to obtain a loss value, and adjusting the adjustable parameters in the initial neural network according to the loss value until the loss value meets a convergence condition to obtain the target neural network.
In one embodiment, the apparatus further comprises:
the updating module is used for updating the historical image set according to the predicted image;
and the future image obtaining module is used for repeatedly executing the steps of determining the optical flow change information among the N frames of historical images, predicting the optical flow change information by utilizing a pre-trained target neural network, and obtaining a prediction image according to the prediction result and the preset frame historical images in the historical image set so as to obtain a video image in a future period.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a historical image set; the historical image set comprises N frames of historical images which are continuous in time, wherein N is a positive integer greater than 1;
determining optical flow change information of the N frames of historical images; the optical flow change information is used for representing optical flow change characteristics between every two frames of historical images;
and predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to a prediction result and a preset frame historical image in the historical image set.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a historical image set; the historical image set comprises N frames of historical images which are continuous in time, wherein N is a positive integer greater than 1;
determining optical flow change information of the N frames of historical images; the optical flow change information is used for representing optical flow change characteristics between every two frames of historical images;
and predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to a prediction result and a preset frame historical image in the historical image set.
According to the image prediction method, the computer equipment and the storage medium, the server acquires the historical image set, determines the optical flow change information of the N frames of historical images, predicts the optical flow change information by using a pre-trained target neural network, and obtains the prediction image according to the prediction result and the preset frames of historical images in the historical image set. According to the embodiment of the disclosure, the optical flow change information among historical images is obtained first, and then the target neural network is utilized to learn the optical flow change information to obtain the predicted image.
Drawings
FIG. 1 is a diagram illustrating an exemplary embodiment of an image prediction method;
FIG. 2 is a flow diagram illustrating a method for image prediction in one embodiment;
FIG. 3 is a flowchart illustrating a step of predicting optical flow variation information and obtaining a predicted image according to an embodiment;
FIG. 4 is a schematic flow chart diagram illustrating the steps of training a target neural network in one embodiment;
FIG. 5 is a flowchart illustrating an image prediction method according to another embodiment;
FIG. 6 is a block diagram showing the structure of an image prediction apparatus according to an embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The image prediction method provided by the application can be applied to the application environment shown in fig. 1. The application environment includes a terminal 102 and a server 104, the terminal 102 communicating with the server 104 through a network. The terminal 102 collects an image and sends the image to the server 104; the server performs prediction according to the image collected by the terminal and sends the predicted image to the terminal 102 for display. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, an image prediction method is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps:
in step 201, the server obtains a historical image set.
The historical image set comprises N frames of historical images which are continuous in time, and N is a positive integer larger than 1. For example, the history image set includes 10 frames of history images arranged in order from front to back in time. The number of the history images in the history image set is not limited in the embodiment of the present disclosure.
In one embodiment, the acquisition time interval between every two frames of the historical images is a preset time length. For example, the acquisition time interval between the 1 st frame of history image and the 2 nd frame of history image, the acquisition time interval between the 2 nd frame of history image and the 3 rd frame of history image, and the acquisition time interval between the N-1 st frame of history image and the N-1 st frame of history image are all 30 seconds. The embodiment of the present disclosure does not limit the preset duration.
When image prediction is performed, a terminal may collect a video image and send the collected video image to a server for storage. And then the server selects N frames of historical images with continuous time from the pre-stored video images to obtain a historical image set. Or the server acquires the video image acquired by the terminal in real time, and intercepts N continuous frames of historical images from the video image to obtain a historical image set. The embodiment of the present disclosure does not limit the manner of acquiring the historical image set.
In practical application, the video image can be a real-time image acquired by a camera under an automatic driving scene; the spatial distribution map of the preset meteorological elements at a plurality of times in the meteorological prediction scene may be used. For example, if the weather element is a temperature, the video image may be a spatial profile of the temperature at a plurality of times. The embodiment of the present disclosure does not limit the preset meteorological elements.
In step 202, optical flow change information of the N frames of historical images is determined.
Wherein, the optical flow change information is used for characterizing the optical flow change characteristics between every two frames of historical images.
After obtaining the N frames of historical images, calculating the optical flow change between every two frames of historical images to obtain the optical flow change information of the N frames of historical images. For example, the optical flow change feature between the 2 nd frame history image and the 1 st frame history image is calculated, the optical flow change feature between the 3 rd frame history image and the 2 nd frame history image is calculated, and the optical flow change feature between the nth frame history image and the N-1 th frame history image is calculated. Or calculating optical flow change characteristics between the 3 rd frame historical image and the 1 st frame historical image, calculating optical flow change characteristics between the 4 th frame historical image and the 2 nd frame historical image, and calculating optical flow change characteristics between the N th frame historical image and the N-2 th frame historical image. The embodiment of the present disclosure does not limit the calculation manner.
And step 203, predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to the prediction result and a preset frame historical image in the historical image set.
After determining the optical flow change information of the N frames of historical images, the server may predict the optical flow change information by using a pre-trained target neural network to obtain a prediction result. Optionally, the server predicts the optical flow change feature between the frame after the nth frame history image and the nth frame history image according to the optical flow change feature between the 2 nd frame history image and the 1 st frame history image, the optical flow change feature between the 3 rd frame history image and the 2 nd frame history image, and the optical flow change feature between the nth frame history image and the N-1 th frame history image by using the target neural network. And then, the server obtains a frame of image after the N frame of historical image according to the predicted optical flow change between the frame of image after the N frame of historical image and the N frame of historical image, and obtains the predicted image. Or the server predicts the optical flow change characteristics between the frame image after the N frame historical image and the N-1 frame historical image by using the target neural network according to the optical flow change characteristics between the 3 rd frame historical image and the 1 st frame historical image, the optical flow change characteristics between the 4 th frame historical image and the 2 nd frame historical image, and the optical flow change characteristics between the N frame historical image and the N-2 th frame historical image. And then, the server obtains a frame of image after the N frame of historical image according to the predicted optical flow change between the frame of image after the N frame of historical image and the N-1 frame of historical image, and the predicted image is obtained. The embodiment of the present disclosure does not limit the preset frame.
For example, the server predicts the optical flow change feature between the 11 th frame image and the 10 th frame image based on the optical flow change feature between the 2 nd frame image and the 1 st frame image, the optical flow change feature between the 3 rd frame image and the 2 nd frame image, and the optical flow change feature between the 10 th frame image and the 9 th frame image by using the target neural network. And then, the server obtains the 11 th frame image according to the predicted optical flow change characteristics between the 11 th frame image and the 10 th frame historical image, namely the predicted image. Alternatively, the server predicts the optical flow change feature between the 11 th frame image and the 9 th frame image based on the optical flow change feature between the 3 rd frame image and the 1 st frame image, the optical flow change feature between the 4 th frame image and the 2 nd frame image, or the optical flow change feature between the 10 th frame image and the 8 th frame image using the target neural network. And then, the server obtains the 11 th frame image according to the predicted optical flow change characteristics between the 11 th frame image and the 9 th frame historical image, namely the predicted image.
In the image prediction method, a server acquires a historical image set, determines optical flow change information of N frames of historical images, predicts the optical flow change information by using a pre-trained target neural network, and obtains a prediction image according to a prediction result and a preset frame of historical images in the historical image set. According to the embodiment of the disclosure, the optical flow change information among historical images is obtained first, and then the target neural network is utilized to learn the optical flow change information to obtain the predicted image.
In one embodiment, determining optical flow variation information for the N frames of historical images may include: the server inputs the N frames of historical images into a preset optical flow calculation model to obtain optical flow change information output by the optical flow calculation model.
The optical flow change information comprises an N-1 frame historical optical flow characteristic diagram; n is a positive integer greater than 1.
An optical flow calculation model is set in the server in advance. After the historical image set is obtained, the server takes every two adjacent frames of historical images in the historical image set as an image pair to obtain N-1 image pairs; and sequentially inputting the N-1 image pairs into the optical flow calculation model according to the sequence to obtain the N-1 frame historical optical flow characteristic diagram sequentially output by the optical flow calculation model.
For example, the history image set includes 10 history images, the 1 st frame history image and the 2 nd frame history image are used as the 1 st image pair, the 2 nd frame history image and the 3 rd frame history image are used as the 2 nd image pair, and so on, 9 image pairs are obtained. Then, the 9 image pairs are sequentially input into an optical flow calculation model, and the optical flow calculation model sequentially outputs historical optical flow feature graphs corresponding to the 9 image pairs, namely 9-frame historical optical flow feature graphs are obtained.
As can be understood, the server takes every two adjacent frames of historical images in the historical image set as one image pair to obtain N-1 image pairs; and sequentially inputting the N-1 image pairs into the optical flow calculation model according to the sequence to obtain the N-1 frame historical optical flow characteristic graphs sequentially output by the optical flow calculation model, thereby providing a basis for predicting a subsequent target neural network.
In an embodiment, as shown in fig. 3, the step of predicting the optical flow change information by using a pre-trained target neural network and obtaining a predicted image according to the prediction result and a preset frame history image in the history image set may include:
step 301, the server inputs the historical optical flow characteristic diagram of the N-1 frame into a target neural network for prediction, and a predicted optical flow characteristic diagram output by the target neural network is obtained.
And the server carries out training of the neural network in advance to obtain the target neural network. After the N-1 frame historical optical flow characteristic graph is obtained, the server inputs the N-1 frame historical optical flow characteristic graph into a target neural network, and the target neural network predicts according to the N-1 historical optical flow characteristic graph to obtain a predicted optical flow graph.
For example, the server inputs 9 frames of historical optical flow feature maps into a target neural network, and the target neural network outputs a predicted optical flow feature map which is an optical flow change feature between one frame of image after the 10 th frame of historical image and the 10 th frame of historical image. As can be seen, the predicted optical flow feature map is an optical flow change feature between an image after the nth frame of history image and a preset frame of history image.
And 302, performing deformation processing on a preset frame historical image in the historical image set according to the predicted optical flow characteristic diagram to obtain a predicted image.
After the optical flow change feature between the frame of image after the N frame of historical image and the N frame of historical image is obtained, the server carries out deformation processing on the N frame of historical image according to the optical flow change feature to obtain a prediction image. For example, after obtaining the optical flow change feature between the 10 th frame of history image and the 10 th frame of history image, the server performs a morphing process on the 10 th frame of history image to obtain the 10 th frame of history image, that is, a predicted image.
And if the optical flow change characteristic between the frame of image after the N frame of historical image and the N-1 frame of historical image is obtained, the server carries out deformation processing on the N-1 frame of historical image according to the optical flow change characteristic to obtain a predicted image.
In one embodiment, the process of performing deformation processing on the preset frame history image may include: calculating the target migration position of each pixel point in the historical image of the preset frame according to the predicted optical flow characteristic diagram; and generating a predicted image according to the target migration position of each pixel point and the pixel value of each pixel point.
The predicted optical flow characteristic graph comprises a migration vector in the X direction and a migration vector in the Y direction of each pixel point in the preset frame historical image. After the predicted optical flow characteristic diagram is obtained, the server migrates the pixels according to the migration vector of each pixel in the X direction and the migration vector of each pixel in the Y direction to obtain the target migration position of each pixel. For example, the target migration position of the first pixel is the position of the third pixel. And then, the server can determine the pixel value of each target migration position according to the pixel value of each pixel point, and further generates a prediction image according to the pixel value of each target migration position.
In the process of determining the target migration position, the server may perform image processing such as interpolation and discarding, which is not limited in the embodiment of the present disclosure.
In the process of predicting the optical flow change information by using a pre-trained target neural network and obtaining a predicted image according to a prediction result and a preset frame historical image in a historical image set, the server inputs the N-1 frame historical optical flow feature map into the target neural network for prediction to obtain a predicted optical flow feature map output by the target neural network; and then, carrying out deformation processing on the historical image of the preset frame in the historical image set according to the predicted optical flow characteristic diagram to obtain a predicted image. According to the embodiment of the disclosure, the target neural network is utilized to learn the optical flow change information, that is, the optical flow change information is combined with the neural network to predict, and compared with the prior art, the prediction accuracy is improved.
In one embodiment, as shown in fig. 4, the training process of the target neural network may include:
step 401, the server obtains a training image set.
The training image set comprises N +1 continuous-time training images, the first N training images are training samples, and the N +1 th training image is a label. For example, the training image set includes 11 training images, the 1 st training image to the 10 th training image are training samples, and the 11 th training image is a label.
The server can acquire N +1 frame images with continuous time from the pre-stored video images as a training image set, and can also acquire N +1 frame images with continuous time from the terminal in real time as the training image set. The embodiments of the present disclosure do not limit this.
And step 402, training the neural network based on the training image set to obtain a target neural network.
The target neural network can be a circular convolution neural network, the circular convolution neural network is a three-layer pyramid model, compared with the previous layer of neural network, the input dimensionality of the next layer of neural network is halved, and the number of channels is doubled. Optionally, the convolution kernel is (3, 3). The structure and convolution sum of the target neural network are not limited by the disclosed embodiments.
When training a neural network, inputting the first N frames of training images into a preset optical flow calculation model by a server to obtain an N-1 frame of training optical flow characteristic diagram; inputting the N-1 frame training optical flow characteristic diagram into an initial neural network to obtain an Nth frame training optical flow characteristic diagram; carrying out deformation processing on a preset frame training image according to the N frame training optical flow characteristic diagram to obtain a deformation image; and calculating the deformation image and the label by using a loss function to obtain a loss value, and adjusting the adjustable parameters in the initial neural network according to the loss value until the loss value meets a convergence condition to obtain the target neural network.
In one embodiment, the loss function may be
Figure BDA0002619399880000111
Where MSE is the mean square error, TiIs a label, Ti' is a deformation image. Other functions may also be used as the loss function, which is not limited in this disclosure.
In the training process of the target neural network, the server acquires a training image set, and trains the neural network based on the training image set to obtain the target neural network. According to the embodiment of the disclosure, the neural network is trained according to the optical flow characteristic diagram to obtain the target neural network, that is, the optical flow change information is combined with the neural network, so that compared with the prior art, the prediction accuracy is improved.
In one embodiment, as shown in fig. 5, an image prediction method is provided, which is described by taking the method as an example for being applied to a server, and may include the following steps:
step 501, a server acquires a training image set.
The training image set comprises N +1 continuous-time training images, the first N training images are training samples, and the N +1 training images are labels; n is a positive integer greater than 1.
Step 502, training the neural network based on the training image set to obtain a target neural network.
In one embodiment, a server inputs the previous N frames of training images into a preset optical flow calculation model to obtain an N-1 frame of training optical flow feature diagram; inputting the N-1 frame training optical flow characteristic diagram into an initial neural network to obtain an Nth frame training optical flow characteristic diagram; carrying out deformation processing on a preset frame training image according to the N frame training optical flow characteristic diagram to obtain a deformation image; and calculating the deformation image and the label by using a loss function to obtain a loss value, and adjusting the adjustable parameters in the initial neural network according to the loss value until the loss value meets a convergence condition to obtain the target neural network.
Step 503, acquiring a historical image set.
Wherein the historical image set comprises N frames of historical images which are continuous in time.
In step 504, optical flow change information between the N frames of historical images is determined.
In one embodiment, every two adjacent frames of historical images in the historical image set are used as an image pair to obtain N-1 image pairs; and sequentially inputting the N-1 image pairs into the optical flow calculation model according to the sequence to obtain the N-1 frame historical optical flow characteristic diagram sequentially output by the optical flow calculation model.
And 505, predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to a prediction result and a preset frame historical image in the historical image set.
In one embodiment, inputting the historical optical flow characteristic diagram of the N-1 frames into a target neural network to obtain a predicted optical flow characteristic diagram output by the target neural network; and carrying out deformation processing on the preset frame historical image in the historical image set according to the predicted optical flow characteristic diagram to obtain a predicted image.
Step 506, updating the historical image set according to the predicted image.
After obtaining the prediction image, the server deletes the 1 st frame of history image in the history image set, and the 2 nd frame of history image in the history image set becomes the 1 st frame of history image, and so on, and the nth frame of history image in the history image set becomes the N-1 th frame of history image. After that, the server puts the prediction image into the history image set as the nth frame history image.
And 507, repeatedly executing the steps of determining optical flow change information among the N frames of historical images, predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to the prediction result and the preset frame historical images in the historical image set to obtain a video image in a future period.
After the history image set is updated, the server repeatedly executes step 504 and step 506, so that a new round of prediction can be performed according to the updated history image set to obtain a new prediction image. And then, updating the historical image set according to the new predicted image, and performing the next round of prediction. By analogy, a predicted image can be obtained continuously, so that a video image of a future time period can be obtained.
In the image prediction method, a server trains a target neural network in advance, and then the server acquires a historical image set; determining optical flow change information among the N frames of historical images; and predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to a prediction result and a preset frame historical image in the historical image set. Since the embodiment of the present disclosure performs prediction of optical flow change information using the target neural network, prediction accuracy is improved compared to the prior art. Further, the server updates the historical image set according to the predicted images, repeatedly executes the steps of determining the optical flow change information among the N frames of historical images, predicting the optical flow change information by using a pre-trained target neural network, and obtaining the predicted images according to the prediction result and the preset frames of historical images in the historical image set, so that the video images in the future period are obtained, and long-time image prediction can be realized on the basis of ensuring the prediction accuracy.
It should be understood that although the various steps in the flowcharts of fig. 2-5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-5 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps or stages.
In one embodiment, as shown in fig. 6, there is provided an image prediction apparatus including:
a historical image set obtaining module 601, configured to obtain a historical image set; the historical image set comprises N frames of historical images which are continuous in time, wherein N is a positive integer greater than 1;
an optical flow determining module 602, configured to determine optical flow change information of the N frames of historical images; the optical flow change information is used for representing optical flow change characteristics between every two frames of historical images;
and the prediction module 603 is configured to predict the optical flow change information by using a pre-trained target neural network, and obtain a prediction image according to a prediction result and a preset frame history image in the history image set.
In one embodiment, the optical flow determining module 602 is specifically configured to input the N frames of historical images into a preset optical flow calculation model to obtain optical flow change information output by the optical flow calculation model; the optical flow change information comprises an N-1 frame historical optical flow feature map.
In one embodiment, the optical flow determining module 602 is specifically configured to use every two frames of historical images in the historical image set as one image pair to obtain N-1 image pairs; and sequentially inputting the N-1 image pairs into the optical flow calculation model according to the sequence to obtain the N-1 frame historical optical flow characteristic diagram sequentially output by the optical flow calculation model.
In one embodiment, the prediction module 603 includes:
the prediction sub-module is used for inputting the historical optical flow characteristic diagram of the N-1 frame into a target neural network for prediction to obtain a predicted optical flow characteristic diagram output by the target neural network;
and the image obtaining submodule is used for carrying out deformation processing on the preset frame historical image in the historical image set according to the predicted optical flow characteristic diagram to obtain a predicted image.
In one embodiment, the image obtaining submodule is specifically configured to calculate a target migration position of each pixel point in a preset frame history image according to the predicted optical flow feature map; and generating a predicted image according to the target migration position of each pixel point and the pixel value of each pixel point.
In one embodiment, the apparatus further comprises:
the training image set acquisition module is used for acquiring a training image set; the training image set comprises N +1 continuous training images, the first N training images are training samples, and the (N + 1) th training image is a label;
and the training module is used for training the neural network based on the training image set to obtain the target neural network.
In one embodiment, the training module is specifically configured to input the previous N frames of training images into a preset optical flow calculation model to obtain an N-1 frame of training optical flow feature map; inputting the N-1 frame training optical flow characteristic diagram into an initial neural network to obtain an Nth frame training optical flow characteristic diagram; carrying out deformation processing on a preset frame training image according to the N frame training optical flow characteristic diagram to obtain a deformation image; and calculating the deformation image and the label by using a loss function to obtain a loss value, and adjusting the adjustable parameters in the initial neural network according to the loss value until the loss value meets a convergence condition to obtain the target neural network.
In one embodiment, the apparatus further comprises:
the updating module is used for updating the historical image set according to the predicted image;
and the future image obtaining module is used for repeatedly executing the steps of determining the optical flow change information among the N frames of historical images, predicting the optical flow change information by utilizing a pre-trained target neural network, and obtaining a predicted image according to the prediction result and the preset frame historical images in the historical image set to obtain a video image in a future period.
For specific limitations of the image prediction apparatus, reference may be made to the above limitations of the image prediction method, which are not described herein again. The respective modules in the image prediction apparatus may be wholly or partially implemented by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing image prediction data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an image prediction method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
acquiring a historical image set; the historical image set comprises N frames of historical images which are continuous in time, wherein N is a positive integer greater than 1;
determining optical flow change information of the N frames of historical images; the optical flow change information is used for representing optical flow change characteristics between every two frames of historical images;
and predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to a prediction result and a preset frame historical image in the historical image set.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
inputting the N frames of historical images into a preset optical flow calculation model to obtain optical flow change information output by the optical flow calculation model; the optical flow change information comprises an N-1 frame historical optical flow feature map.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
taking every two adjacent frames of historical images in the historical image set as an image pair to obtain N-1 image pairs;
and sequentially inputting the N-1 image pairs into the optical flow calculation model according to the sequence to obtain the N-1 frame historical optical flow characteristic diagram sequentially output by the optical flow calculation model.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
inputting the N-1 frame historical optical flow characteristic graph into a target neural network for prediction to obtain a predicted optical flow characteristic graph output by the target neural network;
and carrying out deformation processing on the preset frame historical image in the historical image set according to the predicted optical flow characteristic diagram to obtain a predicted image.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
calculating the target migration position of each pixel point in the historical image of the preset frame according to the predicted optical flow characteristic diagram;
and generating a predicted image according to the target migration position of each pixel point and the pixel value of each pixel point.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring a training image set; the training image set comprises N +1 continuous training images, the first N training images are training samples, and the (N + 1) th training image is a label;
and training the neural network based on the training image set to obtain the target neural network.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
inputting the previous N frames of training images into a preset optical flow calculation model to obtain an N-1 frame of training optical flow characteristic diagram;
inputting the N-1 frame training optical flow characteristic diagram into an initial neural network to obtain an Nth frame training optical flow characteristic diagram;
carrying out deformation processing on a preset frame training image according to the N frame training optical flow characteristic diagram to obtain a deformation image;
and calculating the deformation image and the label by using a loss function to obtain a loss value, and adjusting the adjustable parameters in the initial neural network according to the loss value until the loss value meets a convergence condition to obtain the target neural network.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
updating the historical image set according to the predicted image;
and repeatedly executing the steps of determining the optical flow change information among the N frames of historical images, predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to the prediction result and the preset frame historical images in the historical image set to obtain a video image in a future period.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a historical image set; the historical image set comprises N frames of historical images which are continuous in time, wherein N is a positive integer greater than 1;
determining optical flow change information of the N frames of historical images; the optical flow change information is used for representing optical flow change characteristics between every two frames of historical images;
and predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to a prediction result and a preset frame historical image in the historical image set.
In one embodiment, the computer program when executed by the processor further performs the steps of:
inputting the N frames of historical images into a preset optical flow calculation model to obtain optical flow change information output by the optical flow calculation model; the optical flow change information comprises an N-1 frame historical optical flow feature map.
In one embodiment, the computer program when executed by the processor further performs the steps of:
taking every two adjacent frames of historical images in the historical image set as an image pair to obtain N-1 image pairs;
and sequentially inputting the N-1 image pairs into the optical flow calculation model according to the sequence to obtain the N-1 frame historical optical flow characteristic diagram sequentially output by the optical flow calculation model.
In one embodiment, the computer program when executed by the processor further performs the steps of:
inputting the N-1 frame historical optical flow characteristic graph into a target neural network for prediction to obtain a predicted optical flow characteristic graph output by the target neural network;
and carrying out deformation processing on the preset frame historical image in the historical image set according to the predicted optical flow characteristic diagram to obtain a predicted image.
In one embodiment, the computer program when executed by the processor further performs the steps of:
calculating the target migration position of each pixel point in the historical image of the preset frame according to the predicted optical flow characteristic diagram;
and generating a predicted image according to the target migration position of each pixel point and the pixel value of each pixel point.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a training image set; the training image set comprises N +1 continuous training images, the first N training images are training samples, and the (N + 1) th training image is a label;
and training the neural network based on the training image set to obtain the target neural network.
In one embodiment, the computer program when executed by the processor further performs the steps of:
inputting the previous N frames of training images into a preset optical flow calculation model to obtain an N-1 frame of training optical flow characteristic diagram;
inputting the N-1 frame training optical flow characteristic diagram into an initial neural network to obtain an Nth frame training optical flow characteristic diagram;
carrying out deformation processing on a preset frame training image according to the N frame training optical flow characteristic diagram to obtain a deformation image;
and calculating the deformation image and the label by using a loss function to obtain a loss value, and adjusting the adjustable parameters in the initial neural network according to the loss value until the loss value meets a convergence condition to obtain the target neural network.
In one embodiment, the computer program when executed by the processor further performs the steps of:
updating the historical image set according to the predicted image;
and repeatedly executing the steps of determining the optical flow change information among the N frames of historical images, predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to the prediction result and the preset frame historical images in the historical image set to obtain a video image in a future period.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of image prediction, the method comprising:
acquiring a historical image set; the historical image set comprises N frames of historical images which are continuous in time, wherein N is a positive integer greater than 1;
determining optical flow change information of the N frames of historical images; the optical flow change information is used for representing optical flow change characteristics between every two frames of historical images;
and predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to a prediction result and a preset frame historical image in the historical image set.
2. The method of claim 1, wherein said determining optical flow variation information for said N frames of historical images comprises:
inputting the N frames of historical images into a preset optical flow calculation model to obtain the optical flow change information output by the optical flow calculation model; the optical flow change information comprises N-1 frames of historical optical flow feature graphs.
3. The method according to claim 2, wherein the inputting the N-frame history images into a preset optical flow calculation model to obtain the optical flow change information output by the optical flow calculation model comprises:
taking every two adjacent frames of historical images in the historical image set as an image pair to obtain N-1 image pairs;
and sequentially inputting the N-1 image pairs into the optical flow calculation model according to the sequence to obtain the historical optical flow characteristic diagram of the N-1 frames sequentially output by the optical flow calculation model.
4. The method according to claim 2, wherein the predicting the optical flow change information by using a pre-trained target neural network and obtaining a prediction image according to the prediction result and a preset frame history image in the history image set comprises:
inputting the historical optical flow characteristic diagram of the N-1 frame into the target neural network for prediction to obtain a predicted optical flow characteristic diagram output by the target neural network;
and carrying out deformation processing on the preset frame historical image in the historical image set according to the predicted optical flow characteristic diagram to obtain the predicted image.
5. The method according to claim 4, wherein said performing deformation processing on a preset frame history image in the history image set according to the predicted optical flow feature map to obtain the predicted image comprises:
calculating the target migration position of each pixel point in the preset frame historical image according to the predicted optical flow characteristic diagram;
and generating the predicted image according to the target migration position of each pixel point and the pixel value of each pixel point.
6. The method of claim 1, wherein the training process of the target neural network comprises:
acquiring a training image set; the training image set comprises N +1 continuous training images, the first N training images are training samples, and the (N + 1) th training image is a label;
and training a neural network based on the training image set to obtain the target neural network.
7. The method of claim 6, wherein the training of the neural network based on the set of training images to obtain the target neural network comprises:
inputting the first N frames of training images into a preset optical flow calculation model to obtain an N-1 frame of training optical flow characteristic diagram;
inputting the N-1 frame training optical flow feature graph into an initial neural network to obtain an Nth frame training optical flow feature graph;
carrying out deformation processing on a preset frame training image according to the Nth frame training optical flow characteristic diagram to obtain a deformation image;
and calculating the deformation image and the label by using a loss function to obtain a loss value, and adjusting the adjustable parameters in the initial neural network according to the loss value until the loss value meets a convergence condition to obtain the target neural network.
8. The method according to claim 1, wherein after said deriving a predictive picture, the method further comprises:
updating the historical image set according to the predicted image;
and repeatedly executing the steps of determining the optical flow change information of the N frames of historical images, predicting the optical flow change information by using a pre-trained target neural network, and obtaining a predicted image according to the prediction result and the preset frames of historical images in the historical image set to obtain a video image in a future period.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 8.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 8.
CN202010778638.3A 2020-08-05 2020-08-05 Image prediction method, computer device, and storage medium Pending CN111898573A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010778638.3A CN111898573A (en) 2020-08-05 2020-08-05 Image prediction method, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010778638.3A CN111898573A (en) 2020-08-05 2020-08-05 Image prediction method, computer device, and storage medium

Publications (1)

Publication Number Publication Date
CN111898573A true CN111898573A (en) 2020-11-06

Family

ID=73245795

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010778638.3A Pending CN111898573A (en) 2020-08-05 2020-08-05 Image prediction method, computer device, and storage medium

Country Status (1)

Country Link
CN (1) CN111898573A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112581508A (en) * 2020-12-08 2021-03-30 上海眼控科技股份有限公司 Video prediction method, video prediction device, computer equipment and storage medium
CN113724287A (en) * 2021-09-02 2021-11-30 北京华云星地通科技有限公司 Satellite cloud picture prediction method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018093374A (en) * 2016-12-02 2018-06-14 日本電信電話株式会社 Prediction image formation method, prediction image formation device, and computer program
CN110555861A (en) * 2019-08-09 2019-12-10 北京字节跳动网络技术有限公司 optical flow calculation method and device and electronic equipment
CN111192312A (en) * 2019-12-04 2020-05-22 中广核工程有限公司 Depth image acquisition method, device, equipment and medium based on deep learning
CN111340101A (en) * 2020-02-24 2020-06-26 广州虎牙科技有限公司 Stability evaluation method and device, electronic equipment and computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018093374A (en) * 2016-12-02 2018-06-14 日本電信電話株式会社 Prediction image formation method, prediction image formation device, and computer program
CN110555861A (en) * 2019-08-09 2019-12-10 北京字节跳动网络技术有限公司 optical flow calculation method and device and electronic equipment
CN111192312A (en) * 2019-12-04 2020-05-22 中广核工程有限公司 Depth image acquisition method, device, equipment and medium based on deep learning
CN111340101A (en) * 2020-02-24 2020-06-26 广州虎牙科技有限公司 Stability evaluation method and device, electronic equipment and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112581508A (en) * 2020-12-08 2021-03-30 上海眼控科技股份有限公司 Video prediction method, video prediction device, computer equipment and storage medium
CN113724287A (en) * 2021-09-02 2021-11-30 北京华云星地通科技有限公司 Satellite cloud picture prediction method and system

Similar Documents

Publication Publication Date Title
CN110517278B (en) Image segmentation and training method and device of image segmentation network and computer equipment
CN110929622B (en) Video classification method, model training method, device, equipment and storage medium
CN110163344B (en) Neural network training method, device, equipment and storage medium
CN109063742B (en) Butterfly identification network construction method and device, computer equipment and storage medium
CN110334735B (en) Multitask network generation method and device, computer equipment and storage medium
US11144782B2 (en) Generating video frames using neural networks
US20210365726A1 (en) Method and apparatus for object detection in image, vehicle, and robot
CN112613515A (en) Semantic segmentation method and device, computer equipment and storage medium
CN111723707A (en) Method and device for estimating fixation point based on visual saliency
CN107748942A (en) Radar Echo Extrapolation Forecasting Methodology and system based on velocity field sensing network
CN113179421B (en) Video cover selection method and device, computer equipment and storage medium
CN112560796A (en) Human body posture real-time detection method and device, computer equipment and storage medium
CN111667001A (en) Target re-identification method and device, computer equipment and storage medium
CN111047088A (en) Prediction image acquisition method and device, computer equipment and storage medium
CN111898573A (en) Image prediction method, computer device, and storage medium
CN111598213A (en) Network training method, data identification method, device, equipment and medium
CN110738687A (en) Object tracking method, device, equipment and storage medium
CN111079507A (en) Behavior recognition method and device, computer device and readable storage medium
WO2021218037A1 (en) Target detection method and apparatus, computer device and storage medium
CN112749655A (en) Sight tracking method, sight tracking device, computer equipment and storage medium
CN110472588B (en) Anchor point frame determining method and device, computer equipment and storage medium
US20230401737A1 (en) Method for training depth estimation model, training apparatus, and electronic device applying the method
CN117058235A (en) Visual positioning method crossing various indoor scenes
CN117037244A (en) Face security detection method, device, computer equipment and storage medium
CN115115552B (en) Image correction model training method, image correction device and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination