WO2019051701A1 - Photographic terminal, and photographic parameter setting method therefor based on long short-term memory neural network - Google Patents

Photographic terminal, and photographic parameter setting method therefor based on long short-term memory neural network Download PDF

Info

Publication number
WO2019051701A1
WO2019051701A1 PCT/CN2017/101687 CN2017101687W WO2019051701A1 WO 2019051701 A1 WO2019051701 A1 WO 2019051701A1 CN 2017101687 W CN2017101687 W CN 2017101687W WO 2019051701 A1 WO2019051701 A1 WO 2019051701A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
photographing
training
model
neural network
Prior art date
Application number
PCT/CN2017/101687
Other languages
French (fr)
Chinese (zh)
Inventor
雷文
Original Assignee
深圳传音通讯有限公司
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 深圳传音通讯有限公司 filed Critical 深圳传音通讯有限公司
Priority to PCT/CN2017/101687 priority Critical patent/WO2019051701A1/en
Publication of WO2019051701A1 publication Critical patent/WO2019051701A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules

Definitions

  • the present invention relates to the field of photographing technology, and in particular to a photographing terminal and a photographing parameter setting method based on LSTM (Long Short Term Memory).
  • LSTM Long Short Term Memory
  • the present application provides a camera terminal and a camera parameter setting method based on a long-term and short-term memory neural network to meet the diversity requirements of users and improve the user experience.
  • the present application provides a photographing parameter based on a long-term and short-term memory neural network.
  • a setting method wherein the photographing parameter setting method based on the long-term and short-term memory neural network comprises:
  • the photographed parameter setting value is obtained from the long-term and short-term memory neural network LSTM;
  • the photographing parameters are used for photographing.
  • the LSTM predicts the setting value of the camera parameter of the camera terminal, and specifically includes:
  • the historical data is cleaned and normalized
  • the historical data after normalization of the cleaning is divided into a training data set and a test data set according to time;
  • the prediction data is evaluated by using the test data of the test data set for the plurality of neural network models in the combined model, and the weight values occupied by the plurality of neural network models as the combined model are adjusted according to the prediction effect.
  • the method further includes:
  • the camera parameter setting value is predicted by using a scroll time window.
  • the method for predicting the setting value of the photographing parameter by using the rolling time window includes:
  • the predicted value is compared with the actual value, and the actual value is used as a new set of training data according to the comparison result, and substituted into the model to update the model parameter.
  • the obtaining historical data of the photographing parameter includes: acquiring contrast, sensory degree, aperture, shutter, ISO, focus, metering, and white balance to comprehensively obtain historical data of the photographing parameter.
  • the historical data obtained by the comprehensively obtaining the photographing parameters specifically includes:
  • the historical data after the normalization of the cleaning is divided into a training data set and a test data set according to time, including:
  • the early data in the historical data before the specified time is divided into training data sets, and the late data in the historical data after the specified time is divided into test data sets.
  • the method further includes: using the training data of the training data set to generate time series data of different spans; wherein, for each time span (t 0 , t 1 , t 2 , , , t n ), using (t 0 , t 1 , t 2 , , , t n-1 ) as input values, using the difference value between t n-1 and t n to discretize them After being converted, it is converted into the unique heat code data as the supervisory value;
  • Each neural network model of the LSTM is trained separately for each time series data in time series data of different spans.
  • the performing offline model training on the training data of the training data set includes:
  • Training data of the training data set is trained by using a memory-based distributed training method, wherein the training data is distributed to each node and the initial model parameters of the neural network model are broadcast to each node, and each node is based on the current
  • the model parameters and the training data of a certain scale obtain the current gradient and the update amount of the model parameters, update the model parameters by summarizing the model parameter update amount fed back by each node, and broadcast the updated model parameters to each node, and then iteratively repeat To complete the training of a single LSTM neural network model as required.
  • the calculating the weight value of the plurality of neural network models as the combined model comprises: using the training data of multiple time periods, using a linear regression method to obtain the output of each LSTM neural network model in the final combined model The weight value in .
  • the present application further provides a camera terminal, wherein the camera terminal includes a processor, and the processor is configured to execute program data, and the implemented steps include:
  • the photographed parameter setting value is obtained from the long-term and short-term memory neural network LSTM;
  • the photographing parameters are used for photographing.
  • the processor is further configured to use the LSTM to predict a photo parameter setting value of the photographing terminal, which specifically includes:
  • the historical data is cleaned and normalized
  • the historical data after normalization of the cleaning is divided into a training data set and a test data set according to time;
  • the prediction data is evaluated by using the test data of the test data set for the plurality of neural network models in the combined model, and the weight values occupied by the plurality of neural network models as the combined model are adjusted according to the prediction effect.
  • the processor is further configured to predict a photographing parameter setting value by using a rolling time window after adjusting the weight values occupied by the plurality of neural network models as the combined model according to the prediction effect.
  • the processor is specifically configured to convert the added and subtracted value predicted by the combined model into a predicted value of the predicted time, and then fill the currently predicted predicted value into a time window of the next predicted time, and alternately cycle according to the same
  • the processor is configured to compare the predicted value with the actual value, and substitute the actual value as a new set of training data according to the comparison result, and substitute the model into the model to update the model parameter.
  • the processor acquires historical data of the photographing parameter, including: acquiring contrast, sensory degree, aperture, shutter, ISO, focus, metering, and white balance to comprehensively obtain historical data of the photographing parameter.
  • the processor which comprehensively obtains historical data of the photographing parameter, specifically includes:
  • the processor uses the accept-reject sampling method according to the data distribution characteristics of the photographing parameters, and selects similar scenes, similar objects, similar geographical locations, and related data of the same photographer with similarly photographed parameters, together with the data of the photographing parameters.
  • the original historical data is constructed.
  • the processor divides the cleaned normalized historical data into a training data set and a test data set according to time, including:
  • the processor divides the early data in the historical data before the specified time into a training data set, and divides the late data in the historical data after the specified time into the test data set.
  • the processor before performing offline model training on the training data of the training data set, further includes: the processor generating time series data of different spans by using training data of the training data set, where, for each time Span (t 0 , t 1 , t 2 , ... t n ), using (t 0 , t 1 , t 2 , ... t n-1 ) as input values, using t n-1 and t n The difference value between them is discretized and converted into the unique heat code data as the supervisory value;
  • the processor performs offline model training on the training data of the training data set, and the corresponding comprises: the processor training each of the plurality of neural network models of the LSTM by using each time series data in the time series data of different spans.
  • the processor performs offline model training on the training data of the training data set, and specifically includes:
  • the processor performs training on the training data of the training data set by using a distributed training method based on memory calculation, wherein the training data is distributed to each node and the initial model parameters of the neural network model are broadcast to each node, Each node obtains the current gradient and the model parameter update amount according to the current model parameters and the training data of a certain scale, and updates the model parameters by summarizing the model parameter update amount fed back by each node, and broadcasts the updated model parameters to each node. According to this iteration, the training of a single LSTM neural network model is completed as required.
  • the processor calculates a weight value of a plurality of neural network models as a combined model, and specifically includes: the processor uses a plurality of time period training data, and uses a linear regression method to obtain each LSTM neural network. The weight value of the model in the final combined model output.
  • This application uses LSTM to predict the camera parameters, uses LSTM to divide the historical data into training data sets and test data sets according to time, and performs offline model training on the training data of the training data sets to train multiple neural networks of LSTM respectively. a model, and then, obtaining a list of predicted values of the training data for the plurality of trained neural network models, and comparing the predicted value list with the actual photographing setting values to calculate a plurality of neural network models as the combined model The weight value occupied, finally, using the test data of the test data set to evaluate the prediction effect of the plurality of neural network models in the combined model, and adjusting the weight values of the plurality of neural network models as the combined model according to the prediction effect, Finally, multiple neural network models are used to predict the camera parameters that the camera terminal may need to set.
  • the LSTM of the present application can improve the accuracy of prediction by combining models, and greatly reduce the error of prediction.
  • FIG. 1 is a flow chart of an embodiment of a method for setting a photographing parameter based on a long-term and short-term memory neural network according to the present application.
  • FIG. 2 is a schematic flow chart of setting values of photographing parameters of the LSTM predictive photographing terminal of the present application.
  • FIG. 3 is a block diagram of a module of an embodiment of a photographing terminal of the present application.
  • FIG. 1 is a flowchart of an embodiment of a method for setting a photographing parameter based on a long-short-term memory neural network according to the present application.
  • the method for setting a photographing parameter based on an LSTM according to the embodiment includes, but is not limited to, the following steps.
  • step S10 when the photographing terminal starts the photographing function, the photographing terminal obtains the predicted photographing parameter setting value based on the LSTM.
  • Step S20 setting a photographing parameter of the photographing terminal according to the obtained photographing parameter setting value.
  • step S30 the photographing parameter is used for photographing.
  • FIG. 2 is a schematic flowchart of the camera parameter setting value of the LSTM predictive camera terminal of the present application.
  • the LSTM predictive camera terminal setting value of the camera terminal includes, but is not limited to, the following steps.
  • Step S100 Obtain historical data of the photographing parameter.
  • step S100 the acquiring the historical data of the photographing parameter
  • the embodiment may specifically include: acquiring contrast, sensory degree, aperture, shutter, ISO, focus, metering, and white balance to comprehensively obtain the history of the photographing parameter. data.
  • the historical data obtained by synthesizing the photographing parameters may include the following process: according to the data distribution characteristics of the photographing parameters, using the accept-reject sampling method to select similarly similar photographing parameters. Scenes, similar objects, similar geographical locations, and related data of the same photographer, together with the data of the photographing parameters, constitute the original said historical data.
  • Step S101 Perform data cleaning and normalization on the historical data.
  • Step S102 The cleaned normalized historical data is divided into a training data set and a test data set according to time.
  • the historical data that is normalized by the cleaning is divided into the training data set and the test data set according to the time.
  • the data may be specifically included: the early data before the specified time in the historical data. Divided into a training data set, the late data in the historical data after the specified time is divided into test data sets.
  • Step S103 Perform offline model training on the training data of the training data set to train multiple neural network models of the long-term and short-term memory neural network LSTM, respectively.
  • the method may further include: using the training data of the training data set to generate time series data of different spans; wherein, for each time span ( t 0 , t 1 , t 2 , , , t n ), using (t 0 , t 1 , t 2 , , , t n-1 ) as input values, using the difference value between t n-1 and t n After discretizing it, it is converted into the unique heat code data as the supervisory value.
  • the performing offline model training on the training data of the training data set in step S103 may include: training each of the plurality of neural network models of the LSTM by using each time series data in the time series data of different spans.
  • the combined model of this embodiment may be a distributed training mode on a Spark (Distributed Memory Computing) platform.
  • the training data of the training data set is subjected to offline model training, and the embodiment may specifically include: training the training data of the training data set by using a distributed training method based on memory computing, wherein The training data is distributed to each node and the initial model parameters of the neural network model are broadcasted to each node, and each node obtains the current gradient and the model parameter update amount according to the current model parameters and the training data of a certain scale, by summarizing each The model parameter update quantity fed back by the node updates the model parameters, and broadcasts the updated model parameters to each node, and iterates repeatedly to complete the training of the single LSTM neural network model according to requirements.
  • the LSTM model is used for the low precision problem of the regression problem, and the regressive problem of the camera parameter trend prediction is converted into the classification problem by the discretization means, which can effectively improve the prediction accuracy.
  • the training based on the memory computing-based distributed training method of the present embodiment can effectively speed up the training.
  • Step S104 Obtain a predicted value column of the training data for the output of the plurality of neural network models after the training.
  • the table compares the predicted value list with the actual photographing setting value, and calculates a weight value occupied by the plurality of neural network models as the combined model.
  • the embodiment may specifically include: using the training data of multiple time periods, using a linear regression method to obtain each LSTM neural network The weight value of the model in the final combined model output.
  • Step S105 Using the test data of the test data set to evaluate the prediction effect on the plurality of neural network models in the combined model, and adjusting the weight values occupied by the plurality of neural network models as the combined model according to the prediction effect.
  • the present embodiment can propose a method of model combination for the problem that the prediction accuracy of a single LSTM is not high, and the accuracy of the prediction can be improved.
  • the specific application may use the time window of different lengths to generate sequence data for the characteristics of the predicted time series data, train the LSTM model with different sequence data, and then combine them and determine by linear regression method. The weight of each model to improve prediction accuracy.
  • Step S106 predicting the camera parameter setting value by using a rolling time window.
  • the photographing parameter setting value is predicted by using the rolling window.
  • the embodiment may specifically include: converting the added and subtracted value predicted by the combined model into the predicted value of the predicted time, and then predicting the current predicted The predicted value is filled in the time window of the next predicted time, and alternately cycles; when the actual value actually set by the photographing parameter is obtained, the predicted value is compared with the actual value, and the actual value is taken as a group according to the comparison result. New training data is substituted into the model to update the model parameters.
  • the scrolling window may be a single time window rolling cycle, or a plurality of groups of time windows may be scrolled together, which is not limited herein.
  • the supervisory value is also the target value, which is a supervised learning concept involving machine learning in the technical field.
  • the algorithm in the calculation process of the present application passes the difference between the predicted value and the supervised value. The value is calculated, and then the model parameters are updated according to the loss, iteratively iteratively, and the training process in machine learning is realized, and finally the predicted value is the same as the supervised value.
  • the present invention avoids the problem that the simple prediction method of the single LSTM model has large error and low practicability, and further improves the prediction accuracy by calculating and adjusting the weight value of the combined model.
  • the present application may include specific application examples described below.
  • the historical data is cleaned and normalized, and then the cleaned historical data is divided into training data sets and test data sets according to time. For example, the earlier data is divided into training data sets, and the later data is Divided into test data sets.
  • the data of the training data set is used to generate time series data x 1 , x 2 , , x n of different spans, wherein the time spans (1 ⁇ x 1 ⁇ x 2 , , , ⁇ x n ).
  • the present embodiment is based on a distributed training method of memory computing, first distributing data to each node, and then broadcasting the initial model parameters to Each node, each node obtains the current gradient and the model parameter update amount according to the current model parameters and the training data of a certain scale, and then updates the model parameters by summarizing the update amount fed back by each node, and then broadcasts the updated model parameters. Go out, repeat iteratively, and finally complete the training process of a single LSTM neural network model as required.
  • test data set is used to evaluate the prediction effect, and the hyperparameters of the combined model are adjusted according to the evaluation result.
  • the rolling window is used to predict the setting values of the camera parameters, for example, converting the added and subtracted values predicted by the combined model into the predicted specific values, and then predicting the current prediction.
  • the specific value is filled in the time window of the next moment, so that the cycle is alternated.
  • the present application has higher accuracy and robustness for predicting camera parameters.
  • FIG. 3 is a block diagram of an embodiment of a camera terminal of the present application.
  • the present embodiment provides a photographing terminal, which may include a memory 20 for storing program data, a processor 21 for executing program data, and steps of implementing, including but not Limited to the following:
  • the photographed parameter setting value is obtained from the long-term and short-term memory neural network LSTM;
  • the photographing parameters are used for photographing.
  • the processor 21 is further configured to use the LSTM to predict a camera parameter setting value of the camera terminal, and specifically includes the following process.
  • the historical data is cleaned and normalized
  • the historical data after normalization of the cleaning is divided into a training data set and a test data set according to time;
  • the prediction data is evaluated by using the test data of the test data set for the plurality of neural network models in the combined model, and the weight values occupied by the plurality of neural network models as the combined model are adjusted according to the prediction effect.
  • the processor 21 is further configured to predict a photographing parameter setting value by using a rolling time window after adjusting the weight values occupied by the plurality of neural network models as the combined model according to the prediction effect.
  • the processor 21 is specifically configured to convert the added and subtracted value predicted by the combined model into a predicted value of the predicted time, and then fill the currently predicted predicted value into the time window of the next predicted time, and The alternating cycle; and when the actual value actually set by the photographing parameter is obtained, the processor 21 is configured to compare the predicted value with the actual value, and substitute the actual value as a new set of training data according to the comparison result, and substitute the model into Update model parameters.
  • the processor 21 acquires historical data of the photographing parameter, including: acquiring contrast, sensory degree, aperture, shutter, ISO, focus, metering, and white balance to comprehensively obtain historical data of the photographing parameter.
  • the processor 21 divides the cleaned normalized historical data into a training data set and a test data set according to time, and includes: the processor 21: the early data before the specified time in the historical data is located. Divided into a training data set, the late data in the historical data after the specified time is divided into test data sets.
  • the processor 21, before performing the offline model training on the training data of the training data set, further includes: the processor 21 uses the training data of the training data set to generate time series data of different spans, where, for each Time spans (t 0 , t 1 , t 2 , ... t n ), using (t 0 , t 1 , t 2 , ...
  • the processor 21 performs offline model training on the training data of the training data set, and the corresponding includes: the processing The device 21 trains each of the neural network models of the LSTM using each of the time series data in different spans of time series data.
  • the processor 21 performs offline model training on the training data of the training data set, and specifically includes: the processor 21, using the distributed training method based on the memory calculation for the training data of the training data set Training, wherein the training data is distributed to each node and the initial model parameters of the neural network model are broadcast to each node, and each node obtains the current gradient and the model parameter update amount according to the current model parameters and the training data of a certain scale,
  • the model parameters are updated by summarizing the model parameter update amounts fed back by the respective nodes, and the updated model parameters are broadcasted to the respective nodes, and the iteration is repeated to complete the training of the single LSTM neural network model according to the requirements.
  • the processor 21 calculates a weight value of a plurality of neural network models as a combined model, and specifically includes: the processor 21 obtains each LSTM by using a plurality of time period training data and using a linear regression method. The weight value of the neural network model in the final combined model output.
  • the camera terminal of the present application may be a mobile phone, a tablet computer, a wearable device, or a special camera.
  • the wearable device may be a virtual reality helmet or the like, which is not limited herein.
  • This application uses LSTM to predict the camera parameters, uses LSTM to divide the historical data into training data sets and test data sets according to time, and performs offline model training on the training data of the training data sets to train multiple neural networks of LSTM respectively. a model, and then, obtaining a list of predicted values of the training data for the plurality of trained neural network models, and comparing the predicted value list with the actual photographing setting values to calculate a plurality of neural network models as the combined model The weight value occupied, finally, using the test data of the test data set to evaluate the prediction effect of the plurality of neural network models in the combined model, and adjusting the weight values of the plurality of neural network models as the combined model according to the prediction effect, Finally, multiple neural network models are used to predict the camera parameters that the camera terminal may need to set.
  • the LSTM of the present application can improve the accuracy of prediction by combining models, and greatly reduce the error of prediction.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)

Abstract

The present application relates to a photographic terminal, and a photographic parameter setting method therefor based on a long short-term memory neural network. The method comprises: when starting a photography function, a photographic terminal acquiring a predicted photographic parameter setting value from a long short-term memory (LSTM) neural network; setting a photographic parameter of the photographic terminal according to the acquired photographic parameter setting value; and using the photographic parameter for photography. The present application can use an LSTM to predict a photographic parameter setting value desired by a user, automatically sets a photographic parameter according to this, can achieve a better photographic effect, and better complies with the desired effect of the user. The present application does not require a user to manually set a photographic parameter, thereby reducing the difficulty of use for the user, and does not require a user to carry out complicated operation settings, thereby improving the user experience.

Description

拍照终端及其基于长短期记忆神经网络的拍照参数设置方法Photographing terminal and photographing parameter setting method based on long-term and short-term memory neural network 技术领域Technical field
本申请涉及拍照技术领域,具体涉及一种拍照终端及其基于LSTM(Long Short Term Memory,长短期记忆神经网络)的拍照参数设置方法。The present invention relates to the field of photographing technology, and in particular to a photographing terminal and a photographing parameter setting method based on LSTM (Long Short Term Memory).
背景技术Background technique
随着电子产品和信息存储技术的发展,数字相机/摄像机凭借着实用、便捷、价格低廉以及友好的操作界面,已经被普通用户广泛使用。为了使广大用户尤其是非专业摄影用户拍出优秀的摄像作品,各相机商家在宣传相机的同时,还推出各自内置的参数自动设置软件,例如自动对焦,闪关灯自动闭合等等。这些内置的功能为用户提供了更便捷的操作界面。With the development of electronic products and information storage technology, digital cameras/cameras have been widely used by ordinary users because of their practicality, convenience, low price and friendly operation interface. In order to enable the majority of users, especially non-professional photographers to shoot excellent camera works, each camera business also promotes the camera, but also introduces their own built-in parameter automatic setting software, such as auto focus, flash off light automatically closed and so on. These built-in features provide users with a more convenient interface.
但是,对于非专业的普通用户而言,由于技术、经验等原因,而不懂得如何更好地设置拍照参数,这无疑增加了用户的使用难度。此外,对于专业的用户来说,如果在不同拍摄环境下,拍摄不同的对象,都需要反复设置各种参数,则在一定程度上给用户带来不便;而对于一些拍摄因素相类似的场景,用户不一定能设置到类似的参数,导致不能获得较好的拍摄效果。However, for non-professional ordinary users, due to technical, experience and other reasons, and do not know how to better set the camera parameters, this will undoubtedly increase the difficulty of the user. In addition, for professional users, if different objects are photographed in different shooting environments, it is necessary to repeatedly set various parameters, which brings inconvenience to the user to some extent; and for some scenes with similar shooting factors, The user may not be able to set a similar parameter, resulting in a poor shooting result.
技术问题technical problem
不难理解的是,由于影响拍摄的因素过多,而且需要设置的各种拍照参数较多,对于非专业用户而言,不能设置好的参数而导致获取不到较好的拍摄效果,同时对于专业用户而言,一方面,反复手动设置会给用户带来繁复的操作流程,另一方面是针对相类似的场景,难以再次设置到较优的参数、或者无法及时地设置到较优的参数而导致错失了一些拍摄机会。总而言之,现有技术的拍照参数设置方式已经跟不上技术发展的脚步,无法满足用户的多样性需求,用户体验较差。It is not difficult to understand that because there are too many factors affecting the shooting, and there are many various camera parameters that need to be set, for non-professional users, the parameters cannot be set and the better shooting results are not obtained. For professional users, on the one hand, repeated manual settings will bring complicated operation procedures to users, on the other hand, for similar scenarios, it is difficult to set them to better parameters again, or they cannot be set to better parameters in time. It led to missed some shooting opportunities. All in all, the setting method of the camera parameters of the prior art has not kept pace with the development of the technology, and cannot meet the diversity requirements of the user, and the user experience is poor.
技术解决方案Technical solution
针对上述技术问题,本申请提供一种拍照终端及其基于长短期记忆神经网络的拍照参数设置方法,以满足用户的多样性需求,改善用户体验。In view of the above technical problems, the present application provides a camera terminal and a camera parameter setting method based on a long-term and short-term memory neural network to meet the diversity requirements of users and improve the user experience.
为解决上述技术问题,本申请提供一种基于长短期记忆神经网络的拍照参数 设置方法,其中,所述基于长短期记忆神经网络的拍照参数设置方法包括:In order to solve the above technical problem, the present application provides a photographing parameter based on a long-term and short-term memory neural network. a setting method, wherein the photographing parameter setting method based on the long-term and short-term memory neural network comprises:
拍照终端在启动拍摄功能时,从基于长短期记忆神经网络LSTM中获取预测的拍照参数设置值;When the photographing terminal starts the photographing function, the photographed parameter setting value is obtained from the long-term and short-term memory neural network LSTM;
根据获取的所述拍照参数设置值设置拍照终端的拍照参数;Setting a photographing parameter of the photographing terminal according to the obtained photographing parameter setting value;
采用所述拍照参数进行拍摄。The photographing parameters are used for photographing.
其中,LSTM预测拍照终端的拍照参数设置值,具体包括:The LSTM predicts the setting value of the camera parameter of the camera terminal, and specifically includes:
获取拍照参数的历史数据;Obtain historical data of camera parameters;
将所述历史数据进行数据清洗、归一化;The historical data is cleaned and normalized;
将清洗归一化后的历史数据按照时间划分为训练数据集与测试数据集;The historical data after normalization of the cleaning is divided into a training data set and a test data set according to time;
对所述训练数据集的训练数据进行离线模型训练,以分别训练LSTM的多个神经网络模型;Performing off-line model training on the training data of the training data set to separately train multiple neural network models of the LSTM;
获取训练数据对于训练后的多个神经网络模型输出的预测值列表,将所述预测值列表与实际的拍照设置值进行比较,计算得到多个神经网络模型作为组合模型时所占的权重值;Obtaining a list of predicted values output by the training data for the plurality of neural network models after the training, comparing the predicted value list with an actual photographing setting value, and calculating a weight value occupied by the plurality of neural network models as the combined model;
利用测试数据集的测试数据对组合模型中的多个神经网络模型评估预测效果,根据预测效果调整所述多个神经网络模型作为组合模型时所占的权重值。The prediction data is evaluated by using the test data of the test data set for the plurality of neural network models in the combined model, and the weight values occupied by the plurality of neural network models as the combined model are adjusted according to the prediction effect.
其中,所述根据预测效果调整所述多个神经网络模型作为组合模型时所占的权重值之后,还包括:Wherein, after adjusting the weight value of the plurality of neural network models as the combined model according to the prediction effect, the method further includes:
使用滚动时间窗口的方式对拍照参数设置值进行预测。The camera parameter setting value is predicted by using a scroll time window.
其中,所述使用滚动时间窗口的方式对拍照参数设置值进行预测,包括:The method for predicting the setting value of the photographing parameter by using the rolling time window includes:
将组合模型预测的加减值转换为被预测时刻的预测数值,再将当前预测出的预测数值,填入下一被预测时刻的时间窗口,并依此交替循环;Converting the added and subtracted values predicted by the combined model into predicted values of the predicted time, and then filling the currently predicted predicted values into the time window of the next predicted time, and alternately cycling according to this;
当获取到拍照参数实际设置的实际数值时,将预测数值与实际数值对比,并根据对比结果将实际数值作为一组新的训练数据,代入模型以更新模型参数。When the actual value actually set by the photographing parameter is obtained, the predicted value is compared with the actual value, and the actual value is used as a new set of training data according to the comparison result, and substituted into the model to update the model parameter.
其中,所述获取拍照参数的历史数据,包括:获取对比度、感官度、光圈、快门、ISO、对焦、测光和白平衡,以综合得到所述拍照参数的历史数据。The obtaining historical data of the photographing parameter includes: acquiring contrast, sensory degree, aperture, shutter, ISO, focus, metering, and white balance to comprehensively obtain historical data of the photographing parameter.
其中,所述以综合得到所述拍照参数的历史数据,具体包括:The historical data obtained by the comprehensively obtaining the photographing parameters specifically includes:
根据拍照参数的数据分布特点,使用接受-拒绝采样方法,选取分布相似的拍照参数的类似场景、类似对象、类似地理位置和相同拍摄者的相关数据,与拍照参数的数据一并构成原始的所述历史数据。 According to the data distribution characteristics of the photographing parameters, using the accept-reject sampling method, similar scenes, similar objects, similar geographical locations and related data of the same photographer are selected, and the data of the photographing parameters are combined with the data of the photographing parameters to form the original place. State data.
其中,所述将清洗归一化后的历史数据按照时间划分为训练数据集与测试数据集,包括:The historical data after the normalization of the cleaning is divided into a training data set and a test data set according to time, including:
将所述历史数据中时间位于指定时刻之前的早期数据划分为训练数据集,将所述历史数据中时间位于指定时刻之后的晚期数据划分为测试数据集。The early data in the historical data before the specified time is divided into training data sets, and the late data in the historical data after the specified time is divided into test data sets.
其中,所述对所述训练数据集的训练数据进行离线模型训练之前,还包括:使用训练数据集的训练数据生成不同跨度的时间序列数据;其中,对于每个时间跨度(t0,t1,t2、、、tn),使用(t0,t1,t2、、、tn-1)作为输入值,使用tn-1与tn之间的差异值,将其进行离散化后,转换为独热码数据作为监督值;Before performing the offline model training on the training data of the training data set, the method further includes: using the training data of the training data set to generate time series data of different spans; wherein, for each time span (t 0 , t 1 , t 2 , , , t n ), using (t 0 , t 1 , t 2 , , , t n-1 ) as input values, using the difference value between t n-1 and t n to discretize them After being converted, it is converted into the unique heat code data as the supervisory value;
所述对所述训练数据集的训练数据进行离线模型训练,对应包括:Performing offline model training on the training data of the training data set, where the correspondence includes:
使用不同跨度的时间序列数据中的每份时间序列数据分别训练LSTM的多个神经网络模型。Each neural network model of the LSTM is trained separately for each time series data in time series data of different spans.
其中,所述对所述训练数据集的训练数据进行离线模型训练,具体包括:The performing offline model training on the training data of the training data set includes:
对所述训练数据集的训练数据采用基于内存计算的分布式训练方法进行训练,其中,将训练数据分发到各个节点上并将神经网络模型的初始模型参数广播给各个节点,每个节点根据当前的模型参数与一定规模的训练数据,获得当前梯度与模型参数更新量,通过汇总各个节点反馈的模型参数更新量来更新模型参数,并将更新后的模型参数广播给各个节点,依此迭代反复,以根据要求完成单个LSTM神经网络模型的训练。Training data of the training data set is trained by using a memory-based distributed training method, wherein the training data is distributed to each node and the initial model parameters of the neural network model are broadcast to each node, and each node is based on the current The model parameters and the training data of a certain scale obtain the current gradient and the update amount of the model parameters, update the model parameters by summarizing the model parameter update amount fed back by each node, and broadcast the updated model parameters to each node, and then iteratively repeat To complete the training of a single LSTM neural network model as required.
其中,所述计算得到多个神经网络模型作为组合模型时所占的权重值,具体包括:通过多个时段的训练数据,使用线性回归的方法,得到各个LSTM神经网络模型在最终的组合模型输出中的权重值。Wherein, the calculating the weight value of the plurality of neural network models as the combined model comprises: using the training data of multiple time periods, using a linear regression method to obtain the output of each LSTM neural network model in the final combined model The weight value in .
为解决上述技术问题,本申请还提供一种拍照终端,其中,所述拍照终端包括处理器,所述处理器用于执行程序数据,实现的步骤包括:In order to solve the above technical problem, the present application further provides a camera terminal, wherein the camera terminal includes a processor, and the processor is configured to execute program data, and the implemented steps include:
拍照终端在启动拍摄功能时,从基于长短期记忆神经网络LSTM中获取预测的拍照参数设置值;When the photographing terminal starts the photographing function, the photographed parameter setting value is obtained from the long-term and short-term memory neural network LSTM;
根据获取的所述拍照参数设置值设置拍照终端的拍照参数;Setting a photographing parameter of the photographing terminal according to the obtained photographing parameter setting value;
采用所述拍照参数进行拍摄。The photographing parameters are used for photographing.
其中,所述处理器还用于利用LSTM预测拍照终端的拍照参数设置值,具体包括:The processor is further configured to use the LSTM to predict a photo parameter setting value of the photographing terminal, which specifically includes:
获取拍照参数的历史数据; Obtain historical data of camera parameters;
将所述历史数据进行数据清洗、归一化;The historical data is cleaned and normalized;
将清洗归一化后的历史数据按照时间划分为训练数据集与测试数据集;The historical data after normalization of the cleaning is divided into a training data set and a test data set according to time;
对所述训练数据集的训练数据进行离线模型训练,以分别训练长短期记忆神经网络LSTM的多个神经网络模型;Performing off-line model training on the training data of the training data set to separately train multiple neural network models of the long-term and short-term memory neural network LSTM;
获取训练数据对于训练后的多个神经网络模型输出的预测值列表,将所述预测值列表与实际的拍照设置值进行比较,计算得到多个神经网络模型作为组合模型时所占的权重值;Obtaining a list of predicted values output by the training data for the plurality of neural network models after the training, comparing the predicted value list with an actual photographing setting value, and calculating a weight value occupied by the plurality of neural network models as the combined model;
利用测试数据集的测试数据对组合模型中的多个神经网络模型评估预测效果,根据预测效果调整所述多个神经网络模型作为组合模型时所占的权重值。The prediction data is evaluated by using the test data of the test data set for the plurality of neural network models in the combined model, and the weight values occupied by the plurality of neural network models as the combined model are adjusted according to the prediction effect.
其中,所述处理器,还用于在根据预测效果调整所述多个神经网络模型作为组合模型时所占的权重值之后,使用滚动时间窗口的方式对拍照参数设置值进行预测。The processor is further configured to predict a photographing parameter setting value by using a rolling time window after adjusting the weight values occupied by the plurality of neural network models as the combined model according to the prediction effect.
所述处理器,具体用于将组合模型预测的加减值转换为被预测时刻的预测数值,再将当前预测出的预测数值,填入下一被预测时刻的时间窗口,并依此交替循环;且当获取到拍照参数实际设置的实际数值时,所述处理器用于将预测数值与实际数值对比,并根据对比结果将实际数值作为一组新的训练数据,代入模型以更新模型参数。The processor is specifically configured to convert the added and subtracted value predicted by the combined model into a predicted value of the predicted time, and then fill the currently predicted predicted value into a time window of the next predicted time, and alternately cycle according to the same And when the actual value actually set by the photographing parameter is obtained, the processor is configured to compare the predicted value with the actual value, and substitute the actual value as a new set of training data according to the comparison result, and substitute the model into the model to update the model parameter.
其中,所述处理器,获取拍照参数的历史数据,包括:获取对比度、感官度、光圈、快门、ISO、对焦、测光和白平衡,以综合得到所述拍照参数的历史数据。The processor acquires historical data of the photographing parameter, including: acquiring contrast, sensory degree, aperture, shutter, ISO, focus, metering, and white balance to comprehensively obtain historical data of the photographing parameter.
其中,所述处理器,综合得到所述拍照参数的历史数据,具体包括:The processor, which comprehensively obtains historical data of the photographing parameter, specifically includes:
所述处理器根据拍照参数的数据分布特点,使用接受-拒绝采样方法,选取分布相似的拍照参数的类似场景、类似对象、类似地理位置和相同拍摄者的相关数据,与拍照参数的数据一并构成原始的所述历史数据。The processor uses the accept-reject sampling method according to the data distribution characteristics of the photographing parameters, and selects similar scenes, similar objects, similar geographical locations, and related data of the same photographer with similarly photographed parameters, together with the data of the photographing parameters. The original historical data is constructed.
其中,所述处理器,将清洗归一化后的历史数据按照时间划分为训练数据集与测试数据集,包括:The processor divides the cleaned normalized historical data into a training data set and a test data set according to time, including:
所述处理器将所述历史数据中时间位于指定时刻之前的早期数据划分为训练数据集,将所述历史数据中时间位于指定时刻之后的晚期数据划分为测试数据集。The processor divides the early data in the historical data before the specified time into a training data set, and divides the late data in the historical data after the specified time into the test data set.
其中,所述处理器,对所述训练数据集的训练数据进行离线模型训练之前,还包括:所述处理器使用训练数据集的训练数据生成不同跨度的时间序列数据, 其中,对于每个时间跨度(t0,t1,t2,...tn),使用(t0,t1,t2,...tn-1)作为输入值,使用tn-1与tn之间的差异值,将其进行离散化后,转换为独热码数据作为监督值;The processor, before performing offline model training on the training data of the training data set, further includes: the processor generating time series data of different spans by using training data of the training data set, where, for each time Span (t 0 , t 1 , t 2 , ... t n ), using (t 0 , t 1 , t 2 , ... t n-1 ) as input values, using t n-1 and t n The difference value between them is discretized and converted into the unique heat code data as the supervisory value;
所述处理器,对所述训练数据集的训练数据进行离线模型训练,对应包括:所述处理器使用不同跨度的时间序列数据中的每份时间序列数据分别训练LSTM的多个神经网络模型。The processor performs offline model training on the training data of the training data set, and the corresponding comprises: the processor training each of the plurality of neural network models of the LSTM by using each time series data in the time series data of different spans.
其中,所述处理器,对所述训练数据集的训练数据进行离线模型训练,具体包括:The processor performs offline model training on the training data of the training data set, and specifically includes:
所述处理器,对所述训练数据集的训练数据采用基于内存计算的分布式训练方法进行训练,其中,将训练数据分发到各个节点上并将神经网络模型的初始模型参数广播给各个节点,每个节点根据当前的模型参数与一定规模的训练数据,获得当前梯度与模型参数更新量,通过汇总各个节点反馈的模型参数更新量来更新模型参数,并将更新后的模型参数广播给各个节点,依此迭代反复,以根据要求完成单个LSTM神经网络模型的训练。The processor performs training on the training data of the training data set by using a distributed training method based on memory calculation, wherein the training data is distributed to each node and the initial model parameters of the neural network model are broadcast to each node, Each node obtains the current gradient and the model parameter update amount according to the current model parameters and the training data of a certain scale, and updates the model parameters by summarizing the model parameter update amount fed back by each node, and broadcasts the updated model parameters to each node. According to this iteration, the training of a single LSTM neural network model is completed as required.
其中,所述处理器,计算得到多个神经网络模型作为组合模型时所占的权重值,具体包括:所述处理器通过多个时段的训练数据,使用线性回归的方法,得到各个LSTM神经网络模型在最终的组合模型输出中的权重值。The processor calculates a weight value of a plurality of neural network models as a combined model, and specifically includes: the processor uses a plurality of time period training data, and uses a linear regression method to obtain each LSTM neural network. The weight value of the model in the final combined model output.
有益效果Beneficial effect
本申请采用LSTM对拍照参数进行预测,利用LSTM将历史数据按照时间划分为训练数据集与测试数据集,对所述训练数据集的训练数据进行离线模型训练,以分别训练LSTM的多个神经网络模型,接着,获取训练数据对于训练后的多个神经网络模型输出的预测值列表,并将所述预测值列表与实际的拍照设置值进行比较,以计算得到多个神经网络模型作为组合模型时所占的权重值,最终,利用测试数据集的测试数据对组合模型中的多个神经网络模型评估预测效果,根据预测效果调整所述多个神经网络模型作为组合模型时所占的权重值,最终,利用多个神经网络模型预测拍照终端可能需要设置的拍照参数。This application uses LSTM to predict the camera parameters, uses LSTM to divide the historical data into training data sets and test data sets according to time, and performs offline model training on the training data of the training data sets to train multiple neural networks of LSTM respectively. a model, and then, obtaining a list of predicted values of the training data for the plurality of trained neural network models, and comparing the predicted value list with the actual photographing setting values to calculate a plurality of neural network models as the combined model The weight value occupied, finally, using the test data of the test data set to evaluate the prediction effect of the plurality of neural network models in the combined model, and adjusting the weight values of the plurality of neural network models as the combined model according to the prediction effect, Finally, multiple neural network models are used to predict the camera parameters that the camera terminal may need to set.
此外,本申请LSTM通过组合模型的方式,可以提高预测的准确性,较大限度地减小预测的误差。 In addition, the LSTM of the present application can improve the accuracy of prediction by combining models, and greatly reduce the error of prediction.
附图说明DRAWINGS
图1是本申请基于长短期记忆神经网络的拍照参数设置方法一实施方式的流程图。1 is a flow chart of an embodiment of a method for setting a photographing parameter based on a long-term and short-term memory neural network according to the present application.
图2是本申请LSTM预测拍照终端的拍照参数设置值的流程示意图。FIG. 2 is a schematic flow chart of setting values of photographing parameters of the LSTM predictive photographing terminal of the present application.
图3是本申请拍照终端一实施方式的模块框图。3 is a block diagram of a module of an embodiment of a photographing terminal of the present application.
本发明的实施方式Embodiments of the invention
请参阅图1,图1是本申请基于长短期记忆神经网络的拍照参数设置方法一实施方式的流程图,本实施例的所述基于LSTM的拍照参数设置方法包括但不限于如下步骤。Referring to FIG. 1 , FIG. 1 is a flowchart of an embodiment of a method for setting a photographing parameter based on a long-short-term memory neural network according to the present application. The method for setting a photographing parameter based on an LSTM according to the embodiment includes, but is not limited to, the following steps.
步骤S10,拍照终端在启动拍摄功能时,从基于LSTM中获取预测的拍照参数设置值。In step S10, when the photographing terminal starts the photographing function, the photographing terminal obtains the predicted photographing parameter setting value based on the LSTM.
步骤S20,根据获取的所述拍照参数设置值设置拍照终端的拍照参数。Step S20, setting a photographing parameter of the photographing terminal according to the obtained photographing parameter setting value.
步骤S30,采用所述拍照参数进行拍摄。In step S30, the photographing parameter is used for photographing.
请进一步参阅图2,图2是本申请LSTM预测拍照终端的拍照参数设置值的流程示意图,本实施方式LSTM预测拍照终端的拍照参数设置值包括但不限于如下几个步骤。Please refer to FIG. 2 . FIG. 2 is a schematic flowchart of the camera parameter setting value of the LSTM predictive camera terminal of the present application. The LSTM predictive camera terminal setting value of the camera terminal includes, but is not limited to, the following steps.
步骤S100、获取拍照参数的历史数据。Step S100: Obtain historical data of the photographing parameter.
在步骤S100中,所述获取拍照参数的历史数据,本实施例具体可以包括:获取对比度、感官度、光圈、快门、ISO、对焦、测光和白平衡,以综合得到所述拍照参数的历史数据。In step S100, the acquiring the historical data of the photographing parameter, the embodiment may specifically include: acquiring contrast, sensory degree, aperture, shutter, ISO, focus, metering, and white balance to comprehensively obtain the history of the photographing parameter. data.
进一步而言,所述以综合得到所述拍照参数的历史数据,在本实施例中可以包括如下过程:根据拍照参数的数据分布特点,使用接受-拒绝采样方法,选取分布相似的拍照参数的类似场景、类似对象、类似地理位置和相同拍摄者的相关数据,与拍照参数的数据一并构成原始的所述历史数据。Further, the historical data obtained by synthesizing the photographing parameters may include the following process: according to the data distribution characteristics of the photographing parameters, using the accept-reject sampling method to select similarly similar photographing parameters. Scenes, similar objects, similar geographical locations, and related data of the same photographer, together with the data of the photographing parameters, constitute the original said historical data.
不难看出,针对现有实际情况中,选取分布相似的拍照参数的类似场景、类似对象、类似地理位置和相同拍摄者的相关数据,与拍照参数的数据一并构成原始的所述历史数据等等,作为相关历史数据,可以有效地解决存在的历史数据的数据量过少的问题。 It is not difficult to see that, in view of the existing actual situation, similar scenes, similar objects, similar geographical locations, and related data of the same photographer are selected, and the data of the photographing parameters are combined with the data of the photographing parameters to constitute the original historical data. Etc. As relevant historical data, the problem that the amount of data of the existing historical data is too small can be effectively solved.
步骤S101、将所述历史数据进行数据清洗、归一化。Step S101: Perform data cleaning and normalization on the historical data.
步骤S102、将清洗归一化后的历史数据按照时间划分为训练数据集与测试数据集。Step S102: The cleaned normalized historical data is divided into a training data set and a test data set according to time.
需要说明的是,所述将清洗归一化后的历史数据按照时间划分为训练数据集与测试数据集,在本实施例可以具体包括:将所述历史数据中时间位于指定时刻之前的早期数据划分为训练数据集,将所述历史数据中时间位于指定时刻之后的晚期数据划分为测试数据集。It should be noted that the historical data that is normalized by the cleaning is divided into the training data set and the test data set according to the time. In this embodiment, the data may be specifically included: the early data before the specified time in the historical data. Divided into a training data set, the late data in the historical data after the specified time is divided into test data sets.
步骤S103、对所述训练数据集的训练数据进行离线模型训练,以分别训练长短期记忆神经网络LSTM的多个神经网络模型。Step S103: Perform offline model training on the training data of the training data set to train multiple neural network models of the long-term and short-term memory neural network LSTM, respectively.
值得注意的是,在步骤S103对所述训练数据集的训练数据进行离线模型训练之前,还可以包括:使用训练数据集的训练数据生成不同跨度的时间序列数据;其中,对于每个时间跨度(t0,t1,t2、、、tn),使用(t0,t1,t2、、、tn-1)作为输入值,使用tn-1与tn之间的差异值,将其进行离散化后,转换为独热码数据作为监督值。It is noted that, before performing the offline model training on the training data of the training data set in step S103, the method may further include: using the training data of the training data set to generate time series data of different spans; wherein, for each time span ( t 0 , t 1 , t 2 , , , t n ), using (t 0 , t 1 , t 2 , , , t n-1 ) as input values, using the difference value between t n-1 and t n After discretizing it, it is converted into the unique heat code data as the supervisory value.
其中,步骤S103中对所述训练数据集的训练数据进行离线模型训练,可以对应包括:使用不同跨度的时间序列数据中的每份时间序列数据分别训练LSTM的多个神经网络模型。需要说明的是,本实施例的组合模型可以在Spark(分布式内存计算)平台上的分布式训练方式。The performing offline model training on the training data of the training data set in step S103 may include: training each of the plurality of neural network models of the LSTM by using each time series data in the time series data of different spans. It should be noted that the combined model of this embodiment may be a distributed training mode on a Spark (Distributed Memory Computing) platform.
在步骤S103中,所述对所述训练数据集的训练数据进行离线模型训练,本实施例具体可以包括:对所述训练数据集的训练数据采用基于内存计算的分布式训练方法进行训练,其中,将训练数据分发到各个节点上并将神经网络模型的初始模型参数广播给各个节点,每个节点根据当前的模型参数与一定规模的训练数据,获得当前梯度与模型参数更新量,通过汇总各个节点反馈的模型参数更新量来更新模型参数,并将更新后的模型参数广播给各个节点,依此迭代反复,以根据要求完成单个LSTM神经网络模型的训练。In the step S103, the training data of the training data set is subjected to offline model training, and the embodiment may specifically include: training the training data of the training data set by using a distributed training method based on memory computing, wherein The training data is distributed to each node and the initial model parameters of the neural network model are broadcasted to each node, and each node obtains the current gradient and the model parameter update amount according to the current model parameters and the training data of a certain scale, by summarizing each The model parameter update quantity fed back by the node updates the model parameters, and broadcasts the updated model parameters to each node, and iterates repeatedly to complete the training of the single LSTM neural network model according to requirements.
不难看出,本实施例针对LSTM模型用于回归问题上精度低问题,通过离散化手段将拍照参数趋势预测回归问题转换为分类问题,可以有效地提高预测精度。此外,本实施例的基于内存计算的分布式训练方法进行训练,可以有效地加快训练的速度。It is not difficult to see that the LSTM model is used for the low precision problem of the regression problem, and the regressive problem of the camera parameter trend prediction is converted into the classification problem by the discretization means, which can effectively improve the prediction accuracy. In addition, the training based on the memory computing-based distributed training method of the present embodiment can effectively speed up the training.
步骤S104、获取训练数据对于训练后的多个神经网络模型输出的预测值列 表,将所述预测值列表与实际的拍照设置值进行比较,计算得到多个神经网络模型作为组合模型时所占的权重值。Step S104: Obtain a predicted value column of the training data for the output of the plurality of neural network models after the training. The table compares the predicted value list with the actual photographing setting value, and calculates a weight value occupied by the plurality of neural network models as the combined model.
在步骤S104中,所述计算得到多个神经网络模型作为组合模型时所占的权重值,本实施例具体可以包括:通过多个时段的训练数据,使用线性回归的方法,得到各个LSTM神经网络模型在最终的组合模型输出中的权重值。In the step S104, the calculating the weight value of the plurality of neural network models as the combined model, the embodiment may specifically include: using the training data of multiple time periods, using a linear regression method to obtain each LSTM neural network The weight value of the model in the final combined model output.
步骤S105、利用测试数据集的测试数据对组合模型中的多个神经网络模型评估预测效果,根据预测效果调整所述多个神经网络模型作为组合模型时所占的权重值。Step S105: Using the test data of the test data set to evaluate the prediction effect on the plurality of neural network models in the combined model, and adjusting the weight values occupied by the plurality of neural network models as the combined model according to the prediction effect.
不难看出,本实施方式可以针对单个LSTM出现的预测精确度不高的问题,提出模型组合的方法,可以提高预测的准确度。It is not difficult to see that the present embodiment can propose a method of model combination for the problem that the prediction accuracy of a single LSTM is not high, and the accuracy of the prediction can be improved.
具体而言,本实施方式在具体应用时可以针对预测时间序列数据的特点,使用不同长度的时间窗口,生成序列数据,使用不同的序列数据训练LSTM模型,然后将其组合,使用线性回归方法确定各个模型的权重,从而提高预测精度。Specifically, in the specific application, the specific application may use the time window of different lengths to generate sequence data for the characteristics of the predicted time series data, train the LSTM model with different sequence data, and then combine them and determine by linear regression method. The weight of each model to improve prediction accuracy.
步骤S106、使用滚动时间窗口的方式对拍照参数设置值进行预测。Step S106: predicting the camera parameter setting value by using a rolling time window.
在步骤S106中,所述使用滚动窗口的方式对拍照参数设置值进行预测,本实施例具体可以包括:将组合模型预测的加减值转换为被预测时刻的预测数值,再将当前预测出的预测数值,填入下一被预测时刻的时间窗口,并依此交替循环;当获取到拍照参数实际设置的实际数值时,将预测数值与实际数值对比,并根据对比结果将实际数值作为一组新的训练数据,代入模型以更新模型参数。In the step S106, the photographing parameter setting value is predicted by using the rolling window. The embodiment may specifically include: converting the added and subtracted value predicted by the combined model into the predicted value of the predicted time, and then predicting the current predicted The predicted value is filled in the time window of the next predicted time, and alternately cycles; when the actual value actually set by the photographing parameter is obtained, the predicted value is compared with the actual value, and the actual value is taken as a group according to the comparison result. New training data is substituted into the model to update the model parameters.
需要说明的是,滚动窗口的方式可以为逐次单个时间窗口滚动循环,也可以是多组时间窗口一并滚动循环,在此不作限定。It should be noted that the scrolling window may be a single time window rolling cycle, or a plurality of groups of time windows may be scrolled together, which is not limited herein.
在本实施例中,监督值也就是目标值,在本技术领域中为涉及机器学习的监督学习概念,在有监督学习中,本申请计算过程中的算法通过预测数值与监督值之间的差值计算损失,然后根据损失更新模型参数,迭代反复,实现机器学习中的训练过程,最终使得预测数值与监督值相同。In this embodiment, the supervisory value is also the target value, which is a supervised learning concept involving machine learning in the technical field. In supervised learning, the algorithm in the calculation process of the present application passes the difference between the predicted value and the supervised value. The value is calculated, and then the model parameters are updated according to the loss, iteratively iteratively, and the training process in machine learning is realized, and finally the predicted value is the same as the supervised value.
本申请通过组合模型的方式,避免单个LSTM模型的简单预测方法误差较大且实用性较低的问题,并通过计算调整组合模型的权重值,进一步提高预测的准确性。By combining the models, the present invention avoids the problem that the simple prediction method of the single LSTM model has large error and low practicability, and further improves the prediction accuracy by calculating and adjusting the weight value of the combined model.
举例而言,本申请可以包括下述的具体应用例。For example, the present application may include specific application examples described below.
(1)首先获取拍照参数的历史数据; (1) First, obtain historical data of photographing parameters;
(2)将历史数据进行数据清洗、归一化,然后将清洗后的历史数据按照时间划分为训练数据集与测试数据集,比如较为早期的数据被划分为训练数据集,较为晚期的数据被划分为测试数据集。使用训练数据集的数据生成不同跨度的时间序列数据x1,x2、、、xn,其中时间跨度(1<x1<x2、、、<xn)。对于每个时间跨度(t0,t1,t2、、、tn),使用(t0,t1,t2、、、tn-1)作为输入值x,使用tn-1与tn之间的差异值,将其离散化后,转换为独热码数据作为监督值Y。(2) The historical data is cleaned and normalized, and then the cleaned historical data is divided into training data sets and test data sets according to time. For example, the earlier data is divided into training data sets, and the later data is Divided into test data sets. The data of the training data set is used to generate time series data x 1 , x 2 , , x n of different spans, wherein the time spans (1<x 1 <x 2 , , , <x n ). For each time span (t 0 , t 1 , t 2 , , t n ), use (t 0 , t 1 , t 2 , , , t n-1 ) as the input value x, using t n-1 and The difference value between t n is discretized and converted into the unique heat code data as the supervisory value Y.
(3)在训练数据生成好后,进行离线模型的训练,使用训练数据集生成的不同跨度的时间序列数据x1,x2、、、xn,对于每份时间序列数据分别训练LSTM神经网络模型M1,M2、、、Mn(3) After the training data is generated, the offline model is trained, and the time series data x 1 , x 2 , , x n generated by the training data set are used to train the LSTM neural network for each time series data. Model M 1 , M 2 , , , M n .
(4)鉴于深度学习训练速度比较慢,而本实施例需要训练多个模型,因此本实施例基于内存计算的分布式训练方法,首先将数据分发到各个节点上,随后将初始模型参数广播给各个节点,每个节点根据当前的模型参数与一定规模的训练数据,获得当前梯度与模型参数更新量,然后通过汇总各个节点反馈的更新量来更新模型参数,并再将更新后的模型参数广播出去,这样迭代反复,最终根据要求完成单个LSTM神经网络模型的训练过程。(4) In view of the fact that the deep learning training speed is relatively slow, and the present embodiment needs to train multiple models, the present embodiment is based on a distributed training method of memory computing, first distributing data to each node, and then broadcasting the initial model parameters to Each node, each node obtains the current gradient and the model parameter update amount according to the current model parameters and the training data of a certain scale, and then updates the model parameters by summarizing the update amount fed back by each node, and then broadcasts the updated model parameters. Go out, repeat iteratively, and finally complete the training process of a single LSTM neural network model as required.
(5)在训练数据集中随机抽取若干段时间,对于每个训练好的LSTM神经网络模型Mn,输出其对于该段时间(例如:t0时段)的预测值
Figure PCTCN2017101687-appb-000001
得到各个模型的预测值列表
Figure PCTCN2017101687-appb-000002
再以真实的拍照设置值y0作为参照,得到对于t0时段的训练数据
Figure PCTCN2017101687-appb-000003
通过多个时段的训练数据,使用线性回归的方法,得到各个LSTM神经网络模型在最终的组合模型输出中的权重值。
(5) randomly extracting a number of time periods in the training data set, and outputting a predicted value for the time (for example, t 0 period) for each trained LSTM neural network model M n .
Figure PCTCN2017101687-appb-000001
Get a list of predicted values for each model
Figure PCTCN2017101687-appb-000002
Then, using the real photo setting value y 0 as a reference, the training data for the t 0 period is obtained.
Figure PCTCN2017101687-appb-000003
Through the training data of multiple time periods, the weighting values of the respective LSTM neural network models in the final combined model output are obtained using the linear regression method.
(6)对于训练好的组合模型,使用测试数据集评估其预测效果,并根据评估结果调节组合模型的各项超参数。(6) For the trained combination model, the test data set is used to evaluate the prediction effect, and the hyperparameters of the combined model are adjusted according to the evaluation result.
(7)在实际预测过程中借助组合模型,使用滚动窗口的方式实现对拍照参数设置值进行预测,比如:将组合模型预测的加减值转换为被预测的具体数值,再将当前预测出的具体数值,填入下一时刻的时间窗口,这样交替循环。(7) In the actual prediction process, using the combined model, the rolling window is used to predict the setting values of the camera parameters, for example, converting the added and subtracted values predicted by the combined model into the predicted specific values, and then predicting the current prediction. The specific value is filled in the time window of the next moment, so that the cycle is alternated.
(8)当获取到实际设置数据时,将预测结果与实际结果对比,同时作为一组新的训练数据,代入模型,更新模型参数。(8) When the actual setting data is obtained, the prediction result is compared with the actual result, and as a new set of training data, the model is substituted and the model parameters are updated.
通过这种方式,本申请对拍照参数的预测具有更高的准确度与鲁棒性。In this way, the present application has higher accuracy and robustness for predicting camera parameters.
请参阅图3,图3是本申请拍照终端一实施方式的模块框图。 Please refer to FIG. 3. FIG. 3 is a block diagram of an embodiment of a camera terminal of the present application.
本实施方式提供一种拍照终端,所述拍照终端可以包括存储器20和处理器21等,所述存储器20用于存储程序数据,所述处理器21用于执行程序数据,实现的步骤包括但不限于如下:The present embodiment provides a photographing terminal, which may include a memory 20 for storing program data, a processor 21 for executing program data, and steps of implementing, including but not Limited to the following:
拍照终端在启动拍摄功能时,从基于长短期记忆神经网络LSTM中获取预测的拍照参数设置值;When the photographing terminal starts the photographing function, the photographed parameter setting value is obtained from the long-term and short-term memory neural network LSTM;
根据获取的所述拍照参数设置值设置拍照终端的拍照参数;Setting a photographing parameter of the photographing terminal according to the obtained photographing parameter setting value;
采用所述拍照参数进行拍摄。The photographing parameters are used for photographing.
其中,所述处理器21还用于利用LSTM预测拍照终端的拍照参数设置值,具体包括如下过程。The processor 21 is further configured to use the LSTM to predict a camera parameter setting value of the camera terminal, and specifically includes the following process.
获取拍照参数的历史数据;Obtain historical data of camera parameters;
将所述历史数据进行数据清洗、归一化;The historical data is cleaned and normalized;
将清洗归一化后的历史数据按照时间划分为训练数据集与测试数据集;The historical data after normalization of the cleaning is divided into a training data set and a test data set according to time;
对所述训练数据集的训练数据进行离线模型训练,以分别训练长短期记忆神经网络LSTM的多个神经网络模型;Performing off-line model training on the training data of the training data set to separately train multiple neural network models of the long-term and short-term memory neural network LSTM;
获取训练数据对于训练后的多个神经网络模型输出的预测值列表,将所述预测值列表与实际的拍照设置值进行比较,计算得到多个神经网络模型作为组合模型时所占的权重值;Obtaining a list of predicted values output by the training data for the plurality of neural network models after the training, comparing the predicted value list with an actual photographing setting value, and calculating a weight value occupied by the plurality of neural network models as the combined model;
利用测试数据集的测试数据对组合模型中的多个神经网络模型评估预测效果,根据预测效果调整所述多个神经网络模型作为组合模型时所占的权重值。The prediction data is evaluated by using the test data of the test data set for the plurality of neural network models in the combined model, and the weight values occupied by the plurality of neural network models as the combined model are adjusted according to the prediction effect.
其中,所述处理器21,还用于在根据预测效果调整所述多个神经网络模型作为组合模型时所占的权重值之后,使用滚动时间窗口的方式对拍照参数设置值进行预测。The processor 21 is further configured to predict a photographing parameter setting value by using a rolling time window after adjusting the weight values occupied by the plurality of neural network models as the combined model according to the prediction effect.
其中,所述处理器21,具体用于将组合模型预测的加减值转换为被预测时刻的预测数值,再将当前预测出的预测数值,填入下一被预测时刻的时间窗口,并依此交替循环;且当获取到拍照参数实际设置的实际数值时,所述处理器21用于将预测数值与实际数值对比,并根据对比结果将实际数值作为一组新的训练数据,代入模型以更新模型参数。The processor 21 is specifically configured to convert the added and subtracted value predicted by the combined model into a predicted value of the predicted time, and then fill the currently predicted predicted value into the time window of the next predicted time, and The alternating cycle; and when the actual value actually set by the photographing parameter is obtained, the processor 21 is configured to compare the predicted value with the actual value, and substitute the actual value as a new set of training data according to the comparison result, and substitute the model into Update model parameters.
其中,所述处理器21,获取拍照参数的历史数据,包括:获取对比度、感官度、光圈、快门、ISO、对焦、测光和白平衡,以综合得到所述拍照参数的历史数据。 The processor 21 acquires historical data of the photographing parameter, including: acquiring contrast, sensory degree, aperture, shutter, ISO, focus, metering, and white balance to comprehensively obtain historical data of the photographing parameter.
其中,所述处理器21,综合得到所述拍照参数的历史数据,具体包括:所述处理器21根据拍照参数的数据分布特点,使用接受-拒绝采样方法,选取分布相似的拍照参数的类似场景、类似对象、类似地理位置和相同拍摄者的相关数据,与拍照参数的数据一并构成原始的所述历史数据。The processor 21, when comprehensively obtaining the historical data of the photographing parameter, specifically includes: the processor 21 uses the accept-reject sampling method to select a similar scene with similarly distributed photographing parameters according to the data distribution characteristics of the photographing parameters. Similar data, similar geographical locations, and related data of the same photographer, together with the data of the photographing parameters constitute the original historical data.
其中,所述处理器21,将清洗归一化后的历史数据按照时间划分为训练数据集与测试数据集,包括:所述处理器21将所述历史数据中时间位于指定时刻之前的早期数据划分为训练数据集,将所述历史数据中时间位于指定时刻之后的晚期数据划分为测试数据集。The processor 21 divides the cleaned normalized historical data into a training data set and a test data set according to time, and includes: the processor 21: the early data before the specified time in the historical data is located. Divided into a training data set, the late data in the historical data after the specified time is divided into test data sets.
其中,所述处理器21,对所述训练数据集的训练数据进行离线模型训练之前,还包括:所述处理器21使用训练数据集的训练数据生成不同跨度的时间序列数据,其中,对于每个时间跨度(t0,t1,t2,...tn),使用(t0,t1,t2,...tn-1)作为输入值,使用tn-1与tn之间的差异值,将其进行离散化后,转换为独热码数据作为监督值;所述处理器21,对所述训练数据集的训练数据进行离线模型训练,对应包括:所述处理器21使用不同跨度的时间序列数据中的每份时间序列数据分别训练LSTM的多个神经网络模型。The processor 21, before performing the offline model training on the training data of the training data set, further includes: the processor 21 uses the training data of the training data set to generate time series data of different spans, where, for each Time spans (t 0 , t 1 , t 2 , ... t n ), using (t 0 , t 1 , t 2 , ... t n-1 ) as input values, using t n-1 and t The difference value between n is discretized and converted into the unique heat code data as the supervisory value; the processor 21 performs offline model training on the training data of the training data set, and the corresponding includes: the processing The device 21 trains each of the neural network models of the LSTM using each of the time series data in different spans of time series data.
其中,所述处理器21,对所述训练数据集的训练数据进行离线模型训练,具体包括:所述处理器21,对所述训练数据集的训练数据采用基于内存计算的分布式训练方法进行训练,其中,将训练数据分发到各个节点上并将神经网络模型的初始模型参数广播给各个节点,每个节点根据当前的模型参数与一定规模的训练数据,获得当前梯度与模型参数更新量,通过汇总各个节点反馈的模型参数更新量来更新模型参数,并将更新后的模型参数广播给各个节点,依此迭代反复,以根据要求完成单个LSTM神经网络模型的训练。The processor 21 performs offline model training on the training data of the training data set, and specifically includes: the processor 21, using the distributed training method based on the memory calculation for the training data of the training data set Training, wherein the training data is distributed to each node and the initial model parameters of the neural network model are broadcast to each node, and each node obtains the current gradient and the model parameter update amount according to the current model parameters and the training data of a certain scale, The model parameters are updated by summarizing the model parameter update amounts fed back by the respective nodes, and the updated model parameters are broadcasted to the respective nodes, and the iteration is repeated to complete the training of the single LSTM neural network model according to the requirements.
其中,所述处理器21,计算得到多个神经网络模型作为组合模型时所占的权重值,具体包括:所述处理器21通过多个时段的训练数据,使用线性回归的方法,得到各个LSTM神经网络模型在最终的组合模型输出中的权重值。The processor 21 calculates a weight value of a plurality of neural network models as a combined model, and specifically includes: the processor 21 obtains each LSTM by using a plurality of time period training data and using a linear regression method. The weight value of the neural network model in the final combined model output.
需要说明的是,本申请的拍照终端,可以为手机、平板电脑、可穿戴设备或者专门的摄像机,其中,可穿戴设备可以为虚拟现实头盔等,在此不作限定。It should be noted that the camera terminal of the present application may be a mobile phone, a tablet computer, a wearable device, or a special camera. The wearable device may be a virtual reality helmet or the like, which is not limited herein.
工业实用性 Industrial applicability
本申请采用LSTM对拍照参数进行预测,利用LSTM将历史数据按照时间划分为训练数据集与测试数据集,对所述训练数据集的训练数据进行离线模型训练,以分别训练LSTM的多个神经网络模型,接着,获取训练数据对于训练后的多个神经网络模型输出的预测值列表,并将所述预测值列表与实际的拍照设置值进行比较,以计算得到多个神经网络模型作为组合模型时所占的权重值,最终,利用测试数据集的测试数据对组合模型中的多个神经网络模型评估预测效果,根据预测效果调整所述多个神经网络模型作为组合模型时所占的权重值,最终,利用多个神经网络模型预测拍照终端可能需要设置的拍照参数。This application uses LSTM to predict the camera parameters, uses LSTM to divide the historical data into training data sets and test data sets according to time, and performs offline model training on the training data of the training data sets to train multiple neural networks of LSTM respectively. a model, and then, obtaining a list of predicted values of the training data for the plurality of trained neural network models, and comparing the predicted value list with the actual photographing setting values to calculate a plurality of neural network models as the combined model The weight value occupied, finally, using the test data of the test data set to evaluate the prediction effect of the plurality of neural network models in the combined model, and adjusting the weight values of the plurality of neural network models as the combined model according to the prediction effect, Finally, multiple neural network models are used to predict the camera parameters that the camera terminal may need to set.
此外,本申请LSTM通过组合模型的方式,可以提高预测的准确性,较大限度地减小预测的误差。 In addition, the LSTM of the present application can improve the accuracy of prediction by combining models, and greatly reduce the error of prediction.

Claims (10)

  1. 一种基于长短期记忆神经网络的拍照参数设置方法,其中,所述基于长短期记忆神经网络的拍照参数设置方法包括:A photographing parameter setting method based on a long-term and short-term memory neural network, wherein the photographing parameter setting method based on the long-term and short-term memory neural network comprises:
    拍照终端在启动拍摄功能时,从基于长短期记忆神经网络LSTM中获取预测的拍照参数设置值;When the photographing terminal starts the photographing function, the photographed parameter setting value is obtained from the long-term and short-term memory neural network LSTM;
    根据获取的所述拍照参数设置值设置拍照终端的拍照参数;Setting a photographing parameter of the photographing terminal according to the obtained photographing parameter setting value;
    采用所述拍照参数进行拍摄。The photographing parameters are used for photographing.
  2. 根据权利要求1所述的基于长短期记忆神经网络的拍照参数设置方法,其中,LSTM预测拍照终端的拍照参数设置值,具体包括:The photographing parameter setting method based on the long-short-term memory neural network according to claim 1, wherein the LSTM predicts a photographing parameter setting value of the photographing terminal, specifically comprising:
    获取拍照参数的历史数据;Obtain historical data of camera parameters;
    将所述历史数据进行数据清洗、归一化;The historical data is cleaned and normalized;
    将清洗归一化后的历史数据按照时间划分为训练数据集与测试数据集;The historical data after normalization of the cleaning is divided into a training data set and a test data set according to time;
    对所述训练数据集的训练数据进行离线模型训练,以分别训练LSTM的多个神经网络模型;Performing off-line model training on the training data of the training data set to separately train multiple neural network models of the LSTM;
    获取训练数据对于训练后的多个神经网络模型输出的预测值列表,将所述预测值列表与实际的拍照设置值进行比较,计算得到多个神经网络模型作为组合模型时所占的权重值;Obtaining a list of predicted values output by the training data for the plurality of neural network models after the training, comparing the predicted value list with an actual photographing setting value, and calculating a weight value occupied by the plurality of neural network models as the combined model;
    利用测试数据集的测试数据对组合模型中的多个神经网络模型评估预测效果,根据预测效果调整所述多个神经网络模型作为组合模型时所占的权重值。The prediction data is evaluated by using the test data of the test data set for the plurality of neural network models in the combined model, and the weight values occupied by the plurality of neural network models as the combined model are adjusted according to the prediction effect.
  3. 根据权利要求2所述的基于长短期记忆神经网络的拍照参数设置方法,其中:The photographing parameter setting method based on long-short-term memory neural network according to claim 2, wherein:
    所述根据预测效果调整所述多个神经网络模型作为组合模型时所占的权重值之后,还包括:使用滚动时间窗口的方式对拍照参数设置值进行预测;After adjusting the weight values occupied by the plurality of neural network models as the combined model according to the prediction effect, the method further includes: predicting the set values of the photographing parameters by using a rolling time window;
    所述使用滚动时间窗口的方式对拍照参数设置值进行预测,包括:将组合模型预测的加减值转换为被预测时刻的预测数值,再将当前预测出的预测数值,填入下一被预测时刻的时间窗口,并依此交替循环;当获取到拍照参数实际设置的实际数值时,将预测数值与实际数值对比,并根据对比结果将实际数值作为一组新的训练数据,代入模型以更新模型参数。The method for predicting the camera parameter setting value by using the rolling time window includes: converting the added and subtracted value predicted by the combined model into a predicted value of the predicted time, and filling the current predicted predicted value into the next predicted The time window of the moment, and alternately cycles according to this; when the actual value actually set by the photographing parameter is obtained, the predicted value is compared with the actual value, and the actual value is used as a new set of training data according to the comparison result, and the model is updated to be updated. Model parameters.
  4. 根据权利要求2所述的基于长短期记忆神经网络的拍照参数设置方法,其 中,所述获取拍照参数的历史数据,包括:获取对比度、感官度、光圈、快门、ISO、对焦、测光和白平衡,以综合得到所述拍照参数的历史数据;a photographing parameter setting method based on a long-term and short-term memory neural network according to claim 2, The obtaining historical data of the photographing parameter includes: acquiring contrast, sensory degree, aperture, shutter, ISO, focus, metering, and white balance to comprehensively obtain historical data of the photographing parameter;
    所述以综合得到所述拍照参数的历史数据,具体包括:The comprehensively obtaining the historical data of the photographing parameter includes:
    根据拍照参数的数据分布特点,使用接受-拒绝采样方法,选取分布相似的拍照参数的类似场景、类似对象、类似地理位置和相同拍摄者的相关数据,与拍照参数的数据一并构成原始的所述历史数据。According to the data distribution characteristics of the photographing parameters, using the accept-reject sampling method, similar scenes, similar objects, similar geographical locations and related data of the same photographer are selected, and the data of the photographing parameters are combined with the data of the photographing parameters to form the original place. State data.
  5. 根据权利要求2所述的基于长短期记忆神经网络的拍照参数设置方法,其中:The photographing parameter setting method based on long-short-term memory neural network according to claim 2, wherein:
    所述将清洗归一化后的历史数据按照时间划分为训练数据集与测试数据集,包括:将所述历史数据中时间位于指定时刻之前的早期数据划分为训练数据集,将所述历史数据中时间位于指定时刻之后的晚期数据划分为测试数据集;The dividing the normalized historical data into the training data set and the test data set according to time, including: dividing the early data in the historical data before the specified time into the training data set, and using the historical data The late data after the specified time is divided into test data sets;
    所述对所述训练数据集的训练数据进行离线模型训练之前,还包括:使用训练数据集的训练数据生成不同跨度的时间序列数据;其中,对于每个时间跨度(t0,t1,t2、、、tn),使用(t0,t1,t2、、、tn-1)作为输入值,使用tn-1与tn之间的差异值,将其进行离散化后,转换为独热码数据作为监督值;Before performing the offline model training on the training data of the training data set, the method further includes: generating time series data of different spans by using training data of the training data set; wherein, for each time span (t 0 , t 1 , t 2 , , , t n ), using (t 0 , t 1 , t 2 , , , t n-1 ) as the input value, using the difference value between t n-1 and t n to discretize it , converted to single heat code data as a supervisory value;
    所述对所述训练数据集的训练数据进行离线模型训练,对应包括:使用不同跨度的时间序列数据中的每份时间序列数据分别训练LSTM的多个神经网络模型;Performing offline model training on the training data of the training data set, the corresponding method comprises: training each of the plurality of neural network models of the LSTM by using each time series data in the time series data of different spans;
    所述对所述训练数据集的训练数据进行离线模型训练,具体包括:对所述训练数据集的训练数据采用基于内存计算的分布式训练方法进行训练,其中,将训练数据分发到各个节点上并将神经网络模型的初始模型参数广播给各个节点,每个节点根据当前的模型参数与一定规模的训练数据,获得当前梯度与模型参数更新量,通过汇总各个节点反馈的模型参数更新量来更新模型参数,并将更新后的模型参数广播给各个节点,依此迭代反复,以根据要求完成单个LSTM神经网络模型的训练;Performing offline model training on the training data of the training data set specifically includes: training training data of the training data set by using a distributed training method based on memory computing, wherein the training data is distributed to each node. The initial model parameters of the neural network model are broadcasted to each node, and each node obtains the current gradient and the model parameter update amount according to the current model parameters and the training data of a certain scale, and updates by updating the model parameter update amount fed back by each node. Model parameters, and broadcast the updated model parameters to each node, and iteratively iteratively, to complete the training of a single LSTM neural network model according to requirements;
    所述计算得到多个神经网络模型作为组合模型时所占的权重值,具体包括通过多个时段的训练数据,使用线性回归的方法,得到各个LSTM神经网络模型在最终的组合模型输出中的权重值。The calculation calculates the weight values of the plurality of neural network models as the combined model, specifically including the training data through multiple time periods, and uses the linear regression method to obtain the weight of each LSTM neural network model in the final combined model output. value.
  6. 一种拍照终端,其中,所述拍照终端包括处理器,所述处理器用于执行程序数据,实现的步骤包括: A camera terminal, wherein the camera terminal includes a processor, and the processor is configured to execute program data, and the implemented steps include:
    拍照终端在启动拍摄功能时,从基于长短期记忆神经网络LSTM中获取预测的拍照参数设置值;When the photographing terminal starts the photographing function, the photographed parameter setting value is obtained from the long-term and short-term memory neural network LSTM;
    根据获取的所述拍照参数设置值设置拍照终端的拍照参数;Setting a photographing parameter of the photographing terminal according to the obtained photographing parameter setting value;
    采用所述拍照参数进行拍摄。The photographing parameters are used for photographing.
  7. 根据权利要求6所述的拍照终端,其中,所述处理器还用于利用LSTM预测拍照终端的拍照参数设置值,具体包括:The photographing terminal according to claim 6, wherein the processor is further configured to use the LSTM to predict a photographing parameter setting value of the photographing terminal, which specifically includes:
    获取拍照参数的历史数据;Obtain historical data of camera parameters;
    将所述历史数据进行数据清洗、归一化;The historical data is cleaned and normalized;
    将清洗归一化后的历史数据按照时间划分为训练数据集与测试数据集;The historical data after normalization of the cleaning is divided into a training data set and a test data set according to time;
    对所述训练数据集的训练数据进行离线模型训练,以分别训练长短期记忆神经网络LSTM的多个神经网络模型;Performing off-line model training on the training data of the training data set to separately train multiple neural network models of the long-term and short-term memory neural network LSTM;
    获取训练数据对于训练后的多个神经网络模型输出的预测值列表,将所述预测值列表与实际的拍照设置值进行比较,计算得到多个神经网络模型作为组合模型时所占的权重值;Obtaining a list of predicted values output by the training data for the plurality of neural network models after the training, comparing the predicted value list with an actual photographing setting value, and calculating a weight value occupied by the plurality of neural network models as the combined model;
    利用测试数据集的测试数据对组合模型中的多个神经网络模型评估预测效果,根据预测效果调整所述多个神经网络模型作为组合模型时所占的权重值。The prediction data is evaluated by using the test data of the test data set for the plurality of neural network models in the combined model, and the weight values occupied by the plurality of neural network models as the combined model are adjusted according to the prediction effect.
  8. 根据权利要求7所述的拍照终端,其中:The photographing terminal according to claim 7, wherein:
    所述处理器,还用于在根据预测效果调整所述多个神经网络模型作为组合模型时所占的权重值之后,使用滚动时间窗口的方式对拍照参数设置值进行预测;The processor is further configured to: after adjusting the weight values occupied by the plurality of neural network models as the combined model according to the prediction effect, predicting the set values of the photographing parameters by using a rolling time window;
    所述处理器,具体用于将组合模型预测的加减值转换为被预测时刻的预测数值,再将当前预测出的预测数值,填入下一被预测时刻的时间窗口,并依此交替循环;且当获取到拍照参数实际设置的实际数值时,所述处理器用于将预测数值与实际数值对比,并根据对比结果将实际数值作为一组新的训练数据,代入模型以更新模型参数。The processor is specifically configured to convert the added and subtracted value predicted by the combined model into a predicted value of the predicted time, and then fill the currently predicted predicted value into a time window of the next predicted time, and alternately cycle according to the same And when the actual value actually set by the photographing parameter is obtained, the processor is configured to compare the predicted value with the actual value, and substitute the actual value as a new set of training data according to the comparison result, and substitute the model into the model to update the model parameter.
  9. 根据权利要求7所述的拍照终端,其中,所述处理器,获取拍照参数的历史数据,包括:获取对比度、感官度、光圈、快门、ISO、对焦、测光和白平衡,以综合得到所述拍照参数的历史数据;所述处理器,综合得到所述拍照参数的历史数据,具体包括:The photographing terminal according to claim 7, wherein the processor acquires historical data of photographing parameters, including: obtaining contrast, sensory degree, aperture, shutter, ISO, focus, metering, and white balance, to obtain a comprehensive The historical data of the photographing parameter; the processor, which comprehensively obtains the historical data of the photographing parameter, specifically includes:
    所述处理器根据拍照参数的数据分布特点,使用接受-拒绝采样方法,选取分布相似的拍照参数的类似场景、类似对象、类似地理位置和相同拍摄者的相关 数据,与拍照参数的数据一并构成原始的所述历史数据。The processor uses the accept-reject sampling method according to the data distribution characteristics of the photographing parameters, and selects similar scenes, similar objects, similar geographical locations, and related photographers with similarly distributed photographing parameters. The data, together with the data of the photographing parameters, constitutes the original said historical data.
  10. 根据权利要求7所述的拍照终端,其中:The photographing terminal according to claim 7, wherein:
    所述处理器,将清洗归一化后的历史数据按照时间划分为训练数据集与测试数据集,包括:所述处理器将所述历史数据中时间位于指定时刻之前的早期数据划分为训练数据集,将所述历史数据中时间位于指定时刻之后的晚期数据划分为测试数据集;The processor divides the cleaned normalized historical data into a training data set and a test data set according to time, and the processor includes: dividing, by the processor, early data before the specified time in the historical data into training data. a set, the late data in the historical data after the specified time is divided into test data sets;
    所述处理器,对所述训练数据集的训练数据进行离线模型训练之前,还包括:所述处理器使用训练数据集的训练数据生成不同跨度的时间序列数据,其中,对于每个时间跨度(t0,t1,t2,...tn),使用(t0,t1,t2,...tn-1)作为输入值,使用tn-1与tn之间的差异值,将其进行离散化后,转换为独热码数据作为监督值;The processor, before performing offline model training on the training data of the training data set, further includes: the processor generating time series data of different spans using the training data of the training data set, where, for each time span ( t 0 , t 1 , t 2 , ... t n ), using (t 0 , t 1 , t 2 , ... t n-1 ) as the input value, using between t n-1 and t n The difference value, after discretizing it, is converted into the unique heat code data as the supervisory value;
    所述处理器,对所述训练数据集的训练数据进行离线模型训练,对应包括:所述处理器使用不同跨度的时间序列数据中的每份时间序列数据分别训练LSTM的多个神经网络模型;The processor performs offline model training on the training data of the training data set, and the corresponding comprises: the processor training each of the plurality of neural network models of the LSTM by using each time series data in the time series data of different spans;
    所述处理器,对所述训练数据集的训练数据进行离线模型训练,具体包括:所述处理器,对所述训练数据集的训练数据采用基于内存计算的分布式训练方法进行训练,其中,将训练数据分发到各个节点上并将神经网络模型的初始模型参数广播给各个节点,每个节点根据当前的模型参数与一定规模的训练数据,获得当前梯度与模型参数更新量,通过汇总各个节点反馈的模型参数更新量来更新模型参数,并将更新后的模型参数广播给各个节点,依此迭代反复,以根据要求完成单个LSTM神经网络模型的训练;The processor performs offline model training on the training data of the training data set, and specifically includes: the processor, training the training data of the training data set by using a distributed training method based on memory computing, where The training data is distributed to each node and the initial model parameters of the neural network model are broadcasted to each node, and each node obtains the current gradient and the model parameter update amount according to the current model parameters and the training data of a certain scale, by summarizing the nodes. The updated model parameter update quantity is used to update the model parameters, and the updated model parameters are broadcasted to each node, and iteratively iteratively, to complete the training of a single LSTM neural network model according to requirements;
    所述处理器,计算得到多个神经网络模型作为组合模型时所占的权重值,具体包括:所述处理器通过多个时段的训练数据,使用线性回归的方法,得到各个LSTM神经网络模型在最终的组合模型输出中的权重值。 The processor calculates a weight value of the plurality of neural network models as a combined model, and specifically includes: the processor uses a plurality of time period training data, and uses a linear regression method to obtain each LSTM neural network model. The weight value in the final combined model output.
PCT/CN2017/101687 2017-09-14 2017-09-14 Photographic terminal, and photographic parameter setting method therefor based on long short-term memory neural network WO2019051701A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/101687 WO2019051701A1 (en) 2017-09-14 2017-09-14 Photographic terminal, and photographic parameter setting method therefor based on long short-term memory neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/101687 WO2019051701A1 (en) 2017-09-14 2017-09-14 Photographic terminal, and photographic parameter setting method therefor based on long short-term memory neural network

Publications (1)

Publication Number Publication Date
WO2019051701A1 true WO2019051701A1 (en) 2019-03-21

Family

ID=65722313

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/101687 WO2019051701A1 (en) 2017-09-14 2017-09-14 Photographic terminal, and photographic parameter setting method therefor based on long short-term memory neural network

Country Status (1)

Country Link
WO (1) WO2019051701A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110705743A (en) * 2019-08-23 2020-01-17 国网浙江省电力有限公司 New energy consumption electric quantity prediction method based on long-term and short-term memory neural network
CN111783947A (en) * 2020-06-24 2020-10-16 上海凯营新能源技术有限公司 Energy consumption prediction method based on LSTM neural network
CN113190036A (en) * 2021-04-02 2021-07-30 华南理工大学 Unmanned aerial vehicle flight trajectory prediction method based on LSTM neural network
CN113435645A (en) * 2021-06-24 2021-09-24 长安大学 Pavement ice-condensation time prediction method, system, device and storage medium
US20220383224A1 (en) * 2021-05-25 2022-12-01 Adobe Inc. Leading indicators and monitor business kpis and metrics for preemptive action

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090169191A1 (en) * 2007-12-26 2009-07-02 Altek Corporation Method for automatically selecting scene mode
CN103841324A (en) * 2014-02-20 2014-06-04 小米科技有限责任公司 Shooting processing method and device and terminal device
CN104954692A (en) * 2015-06-30 2015-09-30 百度在线网络技术(北京)有限公司 Method and device for controlling camera shooting through terminal equipment
CN106951473A (en) * 2017-03-06 2017-07-14 浙江大学 Towards the construction method of the deep vision question answering system of dysopia personage

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090169191A1 (en) * 2007-12-26 2009-07-02 Altek Corporation Method for automatically selecting scene mode
CN103841324A (en) * 2014-02-20 2014-06-04 小米科技有限责任公司 Shooting processing method and device and terminal device
CN104954692A (en) * 2015-06-30 2015-09-30 百度在线网络技术(北京)有限公司 Method and device for controlling camera shooting through terminal equipment
CN106951473A (en) * 2017-03-06 2017-07-14 浙江大学 Towards the construction method of the deep vision question answering system of dysopia personage

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110705743A (en) * 2019-08-23 2020-01-17 国网浙江省电力有限公司 New energy consumption electric quantity prediction method based on long-term and short-term memory neural network
CN110705743B (en) * 2019-08-23 2023-08-18 国网浙江省电力有限公司 New energy consumption electric quantity prediction method based on long-term and short-term memory neural network
CN111783947A (en) * 2020-06-24 2020-10-16 上海凯营新能源技术有限公司 Energy consumption prediction method based on LSTM neural network
CN113190036A (en) * 2021-04-02 2021-07-30 华南理工大学 Unmanned aerial vehicle flight trajectory prediction method based on LSTM neural network
CN113190036B (en) * 2021-04-02 2023-10-13 华南理工大学 Unmanned aerial vehicle flight track prediction method based on LSTM neural network
US20220383224A1 (en) * 2021-05-25 2022-12-01 Adobe Inc. Leading indicators and monitor business kpis and metrics for preemptive action
US11769100B2 (en) * 2021-05-25 2023-09-26 Adobe, Inc. Leading indicators and monitor business KPIs and metrics for preemptive action
CN113435645A (en) * 2021-06-24 2021-09-24 长安大学 Pavement ice-condensation time prediction method, system, device and storage medium
CN113435645B (en) * 2021-06-24 2023-10-10 长安大学 Pavement ice condensation time prediction method, system, device and storage medium

Similar Documents

Publication Publication Date Title
WO2019051701A1 (en) Photographic terminal, and photographic parameter setting method therefor based on long short-term memory neural network
CN110249622A (en) The camera exposure control of real-time Semantic Aware
CN110012210B (en) Photographing method and device, storage medium and electronic equipment
WO2019114423A1 (en) Method and apparatus for merging model prediction values, and device
KR20210018850A (en) Video restoration method and device, electronic device and storage medium
US10594926B2 (en) Preferred picture taking
US11303801B2 (en) Determining settings of a camera apparatus
CN108174096A (en) Method, apparatus, terminal and the storage medium of acquisition parameters setting
CN106886038B (en) Motion trajectory processing method and device
CN110784659B (en) Exposure control method and device and storage medium
JPWO2020026741A1 (en) Information processing method, information processing device and information processing program
CN111222557A (en) Image classification method and device, storage medium and electronic equipment
JP2020144660A (en) Information processing apparatus, information processing method and program
CN110475117B (en) Image compression method and device, electronic equipment and computer storage medium
CN109151521A (en) A kind of original value-acquiring method of user, device, server and storage medium
CN111199540A (en) Image quality evaluation method, image quality evaluation device, electronic device, and storage medium
CN110874635A (en) Deep neural network model compression method and device
CN105827936B (en) A kind of image processing method and mobile terminal
CN106373107B (en) Smart phone automated graphics deblurring system and method
CN109685015B (en) Image processing method and device, electronic equipment and computer storage medium
WO2023142351A1 (en) Weight adjustment method and apparatus, and storage medium and electronic apparatus
CN110049257A (en) The method and electronic device of a kind of synchronous exposure parameter of determination half
CN113315910A (en) Shooting method, shooting device, computer equipment and storage medium
CN111836274B (en) Service processing method and device
CN115147527A (en) Three-dimensional grid generation model construction method, three-dimensional grid generation method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17925107

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17925107

Country of ref document: EP

Kind code of ref document: A1