CN118377384B - Virtual scene interaction method and system - Google Patents

Virtual scene interaction method and system Download PDF

Info

Publication number
CN118377384B
CN118377384B CN202410799538.7A CN202410799538A CN118377384B CN 118377384 B CN118377384 B CN 118377384B CN 202410799538 A CN202410799538 A CN 202410799538A CN 118377384 B CN118377384 B CN 118377384B
Authority
CN
China
Prior art keywords
data
sequence
interaction
vector
virtual scene
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410799538.7A
Other languages
Chinese (zh)
Other versions
CN118377384A (en
Inventor
方俊钦
毛佳乐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Starfield Information Technologies Co ltd
Original Assignee
Shenzhen Starfield Information Technologies Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Starfield Information Technologies Co ltd filed Critical Shenzhen Starfield Information Technologies Co ltd
Priority to CN202410799538.7A priority Critical patent/CN118377384B/en
Publication of CN118377384A publication Critical patent/CN118377384A/en
Application granted granted Critical
Publication of CN118377384B publication Critical patent/CN118377384B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/017—Gesture based interaction, e.g. based on a set of recognized hand gestures
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00—Computing arrangements based on biological models
    • G06N3/02—Neural networks
    • G06N3/04—Architecture, e.g. interconnection topology
    • G06N3/044—Recurrent networks, e.g. Hopfield networks
    • G06N3/0442—Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00—Computing arrangements based on biological models
    • G06N3/02—Neural networks
    • G06N3/04—Architecture, e.g. interconnection topology
    • G06N3/047—Probabilistic or stochastic networks
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00—Computing arrangements based on biological models
    • G06N3/02—Neural networks
    • G06N3/08—Learning methods
    • G06N3/092—Reinforcement learning
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N7/00—Computing arrangements based on specific mathematical models
    • G06N7/01—Probabilistic graphical models, e.g. probabilistic networks
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00—Three-dimensional [3D] modelling for computer graphics
    • G06T17/005—Tree description, e.g. octree, quadtree
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/20—Movements or behaviour, e.g. gesture recognition
    • G06V40/28—Recognition of hand or arm movements, e.g. recognition of deaf sign language

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Human Computer Interaction (AREA)
  • Probability & Statistics with Applications (AREA)
  • Algebra (AREA)
  • Geometry (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Computer Graphics (AREA)
  • Computational Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Psychiatry (AREA)
  • Social Psychology (AREA)
  • Mathematical Optimization (AREA)
  • Multimedia (AREA)
  • User Interface Of Digital Computer (AREA)
  • Image Analysis (AREA)

Abstract

本发明属于虚拟交互技术领域,本发明公开了一种虚拟场景交互方法和系统;包括:获取用户当前交互指令数据和相关环境数据,将用户当前交互指令数据进行预处理,得到融合交互特征序列;将融合交互特征序列输入至预先构建完成的基于深度强化学习的时间预测模型,得到一个未来时间段内的用户交互序列;根据相关环境数据和用户交互序列,利用预先构建完成的概率图模型,得到未来n个虚拟场景状态;基于未来n个虚拟场景状态渲染出对应的虚拟场景画面,将虚拟场景画面传输至用户端设备,大幅提升了用户的交互体验。

The present invention belongs to the field of virtual interaction technology, and discloses a virtual scene interaction method and system; the method comprises: obtaining current user interaction instruction data and relevant environment data, preprocessing the current user interaction instruction data, and obtaining a fused interaction feature sequence; inputting the fused interaction feature sequence into a pre-built time prediction model based on deep reinforcement learning, and obtaining a user interaction sequence in a future time period; obtaining n future virtual scene states according to relevant environment data and the user interaction sequence, using a pre-built probability graph model; rendering corresponding virtual scene pictures based on the n future virtual scene states, and transmitting the virtual scene pictures to a user-end device, thereby greatly improving the user's interaction experience.

Description

一种虚拟场景交互方法和系统A virtual scene interaction method and system

技术领域Technical Field

本发明涉及虚拟交互技术领域,更具体地说,本发明涉及一种虚拟场景交互方法和系统。The present invention relates to the field of virtual interaction technology, and more specifically, to a virtual scene interaction method and system.

背景技术Background Art

申请公开号为CN115525149A的专利公开了一种虚拟场景与真实场景的数据交互方法、装置及系统,包括真实场景数据获取模块、虚拟场景构建模块和语音融合模块,真实场景数据获取模块将真实用户的手势操作进行识别,得到手势交互数据;虚拟场景构建模块基于手势交互数据和控制交互数据构建虚拟建筑场景;语音融合模块将真实用户的语音信息融合至虚拟建筑场景,得到最终虚拟建筑场景,通过将手势交互数据和语音信息融合,构建虚拟建筑场景,解决了现有的虚拟场景与真实场景的数据交互装置交互的数据不充分的问题。The patent application with the publication number CN115525149A discloses a method, device and system for data interaction between virtual scenes and real scenes, including a real scene data acquisition module, a virtual scene construction module and a voice fusion module. The real scene data acquisition module identifies the gesture operation of the real user to obtain gesture interaction data; the virtual scene construction module constructs a virtual building scene based on the gesture interaction data and the control interaction data; the voice fusion module fuses the voice information of the real user into the virtual building scene to obtain the final virtual building scene. By fusing the gesture interaction data and the voice information to construct the virtual building scene, the problem of insufficient data for interaction between the existing data interaction devices of the virtual scene and the real scene is solved.

但是依然无法充分利用用户手势等丰富的多模态交互信息,这对于虚拟场景交互来说尤为重要,因为手势是用户表达意图的重要方式,由于无法全面捕捉用户的交互意图,导致无法准确预测用户的行为,影响了交互的智能性,其次,现有的虚拟场景交互方法通常只根据用户当前的交互指令来渲染虚拟场景,无法提前预测用户未来的交互行为序列;这就意味着,场景无法及时做出相应的变化,交互体验难免会显得不够流畅和自然,此外,现有方法缺乏对虚拟场景上下文环境的建模能力,无法充分利用场景中物体位置、光照条件等重要信息来预测场景的变化,这就导致交互的准确性受到限制,无法真正实现用户与虚拟场景的自然交互。However, it is still impossible to fully utilize rich multimodal interaction information such as user gestures, which is particularly important for virtual scene interaction, because gestures are an important way for users to express their intentions. Since it is impossible to fully capture the user's interaction intentions, it is impossible to accurately predict the user's behavior, which affects the intelligence of the interaction. Secondly, the existing virtual scene interaction methods usually only render the virtual scene according to the user's current interaction instructions, and cannot predict the user's future interaction behavior sequence in advance; this means that the scene cannot make corresponding changes in time, and the interaction experience will inevitably appear not smooth and natural enough. In addition, the existing methods lack the ability to model the context of the virtual scene, and cannot make full use of important information such as the position of objects in the scene and lighting conditions to predict scene changes. This limits the accuracy of the interaction and cannot truly achieve natural interaction between users and virtual scenes.

鉴于此,本发明提出一种虚拟场景交互方法和系统以解决上述问题。In view of this, the present invention proposes a virtual scene interaction method and system to solve the above problems.

发明内容Summary of the invention

为了克服现有技术的上述缺陷,为实现上述目的,本发明提供如下技术方案:一种虚拟场景交互方法,包括:S1、获取用户当前交互指令数据和相关环境数据,将用户当前交互指令数据进行预处理,得到融合交互特征序列;In order to overcome the above-mentioned defects of the prior art and to achieve the above-mentioned purpose, the present invention provides the following technical solutions: A virtual scene interaction method, comprising: S1, obtaining user current interaction instruction data and related environment data, preprocessing the user current interaction instruction data, and obtaining a fused interaction feature sequence;

S2、将融合交互特征序列输入至预先构建完成的基于深度强化学习的时间预测模型,得到一个未来时间段内的用户交互序列;S2. Input the fused interaction feature sequence into the pre-built time prediction model based on deep reinforcement learning to obtain a user interaction sequence in a future time period;

S3、根据相关环境数据和用户交互序列,利用预先构建完成的概率图模型,得到未来n个虚拟场景状态;基于未来n个虚拟场景状态渲染出对应的虚拟场景画面,将虚拟场景画面传输至用户端设备。S3. According to the relevant environmental data and the user interaction sequence, the pre-built probabilistic graph model is used to obtain the future n virtual scene states; based on the future n virtual scene states, the corresponding virtual scene images are rendered, and the virtual scene images are transmitted to the user terminal device.

进一步地,所述用户当前交互指令数据包括用户输入设备操作数据和生物特征数据;Furthermore, the user's current interaction instruction data includes user input device operation data and biometric data;

用户输入设备操作数据包括按键数据、手势数据和设备位移数据;生物特征数据包括眼球运动数据和肢体运动数据;User input device operation data includes key data, gesture data, and device displacement data; biometric data includes eye movement data and limb movement data;

相关环境数据包括用户所处虚拟位置数据、视角方向数据和用户所处环境状态数据;用户所处环境状态数据包括场景物体位置数据和光照数据;所述按键数据包括按键事件的时间戳、按键编码和扫描码;The relevant environment data includes the user's virtual position data, viewing direction data and the user's environment state data; the user's environment state data includes scene object position data and lighting data; the key data includes the timestamp, key code and scan code of the key event;

所述手势数据的获取方式包括:The method for acquiring the gesture data includes:

采用深度相机以固定的帧率持续采集用户手部区域的点云数据,构成点云数据序列;A depth camera is used to continuously collect point cloud data of the user's hand area at a fixed frame rate to form a point cloud data sequence;

从点云数据序列中提取手部精确点云数据,将手部区域点云数据进行降采样,得到完整手部点云数据;Extracting accurate hand point cloud data from the point cloud data sequence, downsampling the hand area point cloud data to obtain complete hand point cloud data;

将完整手部点云数据进行特征提取,得到手掌法向量、指尖位置向量、指根位置向量和指间角度向量;将手掌法向量、指尖位置向量、指根位置向量和指间角度向量拼接得到手势特征向量;The complete hand point cloud data is subjected to feature extraction to obtain the palm normal vector, fingertip position vector, finger base position vector and inter-finger angle vector; the palm normal vector, fingertip position vector, finger base position vector and inter-finger angle vector are concatenated to obtain the gesture feature vector;

将获得的手势特征向量按照时间的先后排列成一个手势特征向量序列,将手势特征向量序列输入至预先训练完成的手势识别模型中,输出对应的手势类型的概率分布,取概率分布中概率最大的手势类型的编码作为手势数据。The obtained gesture feature vectors are arranged into a gesture feature vector sequence in chronological order, the gesture feature vector sequence is input into a pre-trained gesture recognition model, the probability distribution of the corresponding gesture type is output, and the encoding of the gesture type with the largest probability in the probability distribution is taken as the gesture data.

进一步地,所述进行降采样的方式包括:Furthermore, the downsampling method includes:

将点云数据序列有序地插入到预先构建完成的八叉树中,然后以固定的空间分辨率对八叉树进行遍历,得到完整手部点云数据;Insert the point cloud data sequence into the pre-built octree in an orderly manner, and then traverse the octree at a fixed spatial resolution to obtain the complete hand point cloud data;

所述八叉树的构建方式包括:The octree is constructed in the following manner:

将点云数据序列所在的三维空间划分为规则的立方体单元,根据点云数据序列中点的坐标,将每个点插入到对应的立方体单元中,对于包含m个点的立方体单元,将其继续递归划分为8个子单元,直到每个立方体单元内最多只有一个点,即初步完成八叉树的构建;The three-dimensional space where the point cloud data sequence is located is divided into regular cubic units. According to the coordinates of the points in the point cloud data sequence, each point is inserted into the corresponding cubic unit. For a cubic unit containing m points, it is further recursively divided into 8 sub-units until there is at most one point in each cubic unit, that is, the construction of the octree is preliminarily completed;

所述对八叉树进行遍历的方式包括:The method of traversing the octree includes:

设置一个距离阈值d,从八叉树的根节点开始,按照深度优先或广度优先的遍历八叉树的每个节点,对于每个非空的节点,计算节点中所有点到节点中心的距离,选取距离节点中心最近的点作为该节点的代表点;Set a distance threshold d, start from the root node of the octree, traverse each node of the octree in depth-first or breadth-first order, and for each non-empty node, calculate the distance from all points in the node to the center of the node, and select the point closest to the center of the node as the representative point of the node;

初始化一个空的列表L,遍历八叉树的每个非空的节点X,计算X的中心点c和代表点p之间的距离d(c,p),若d(c,p)大于或等于d,则将p加入列表L,最终列表L中的点即为完整手部点云数据;Initialize an empty list L, traverse each non-empty node X of the octree, calculate the distance d(c,p) between the center point c of X and the representative point p, if d(c,p) is greater than or equal to d, then add p to the list L, and finally the points in the list L are the complete hand point cloud data;

其中,距离d(c,p)的计算公式为:The calculation formula of the distance d(c,p) is:

其中,(cx,cy,cz)为中心点c的三维坐标,(px,py,pz)为代表点p的三维坐标。 Among them, (c x , cy ,c z ) are the three-dimensional coordinates of the center point c, and (p x , py ,p z ) are the three-dimensional coordinates of the representative point p.

进一步地,所述进行特征提取的方式包括:Furthermore, the method of performing feature extraction includes:

将完整手部点云数据进行主成分分析,得到主方向向量手掌法向量为与手部所在的三维坐标系的z轴负方向的矢量积,即其中,为z轴的单位向量;Perform principal component analysis on the complete hand point cloud data to obtain the main direction vector Palm normal vector for The vector product of the negative z-axis direction of the three-dimensional coordinate system where the hand is located, that is, in, is the unit vector of the z-axis;

将完整手部点云数据构造成集合P,基于集合P构造完整的凸壳CH(P);The complete hand point cloud data is constructed into a set P, and a complete convex hull CH(P) is constructed based on the set P;

对完整的CH(P)进行层次聚类,得到k+1个层次,记作L0,L1,...,Lk-1,Lk;其中,Lk-1即为指尖点集;Perform hierarchical clustering on the complete CH(P) to obtain k+1 levels, denoted as L0, L1, ..., Lk-1, Lk; where Lk-1 is the fingertip point set;

对Lk-1中的每个点vj,遍历CH(P)上的所有顶点,计算vj到所有顶点的欧几里得距离并取最小值dj,计算完所有vj的dj后,取dj的最小值对应的点,即为指尖位置,将指尖位置进行向量化,即得到指尖位置向量其中,t为手指的索引;For each point vj in Lk-1, traverse all vertices on CH(P), calculate the Euclidean distance from vj to all vertices and take the minimum value dj. After calculating the dj of all vj, take the point corresponding to the minimum value of dj, which is the fingertip position. Vectorize the fingertip position to get the fingertip position vector Where t is the index of the finger;

计算每个指尖位置向量到手掌平面的距离dt,沿手掌平面的法线方向从往回偏移α得到对应指根位置向量其中,α为经验系数;Calculate the position vector of each fingertip Distance dt to the palm plane, along the normal to the palm plane Direction from Shift back α to get the corresponding root position vector Among them, α is the empirical coefficient;

对于任意两相邻的指尖位置向量和计算的矢量和的矢量其中,为t+1手指对应的指根位置向量;For any two adjacent fingertip position vectors and calculate Vector and Vector in, is the finger root position vector corresponding to the t+1 finger;

则基于矢量和计算得到指间角度将指间角度向量化,即得到指间角度向量。Based on vector and Calculate the finger angle The inter-finger angle is vectorized to obtain the inter-finger angle vector.

进一步地,所述凸壳CH(P)的构造方式包括:Furthermore, the construction method of the convex shell CH(P) includes:

初始时,凸壳CH(P)为任意4个不共面的点构成的四面体,对于集合P中的点b,若b在CH(P)内,则忽略b,若b在CH(P)上,则将b添加到CH(P)的顶点集合,若b在CH(P)外,则用b对CH(P)进行遍历划分,生成新的CH(P),最终得到完整的CH(P);Initially, the convex hull CH(P) is a tetrahedron formed by any four non-coplanar points. For a point b in the set P, if b is in CH(P), then b is ignored. If b is on CH(P), then b is added to the vertex set of CH(P). If b is outside CH(P), then b is used to traverse and divide CH(P) to generate a new CH(P), and finally a complete CH(P) is obtained.

所述进行层次聚类的方式包括:The method of performing hierarchical clustering includes:

初始化L0等于CH(P),对于每一个层次Lr,r属于区间[0,k],且k为大于1的正整数;计算Lr中所有点对(vp,vq)的欧几里得距离d(vp,vq),提取最大的欧几里得距离对应的点对(pi,pj),将(pi,pj)合并为一个新的簇,移除pi和pj,将剩余的点和新的簇组成新的点集Lr+1;重复直至Lr+1为空集或只包含一个簇,即完成了对完整的CH(P)的层次聚类。Initialize L0 equal to CH(P). For each level Lr, r belongs to the interval [0, k], and k is a positive integer greater than 1; calculate the Euclidean distance d(vp, vq) of all point pairs (vp, vq) in Lr, extract the point pair (pi, pj) corresponding to the largest Euclidean distance, merge (pi, pj) into a new cluster, remove pi and pj, and form a new point set Lr+1 with the remaining points and the new cluster; repeat until Lr+1 is an empty set or contains only one cluster, and the hierarchical clustering of the complete CH(P) is completed.

进一步地,所述手势识别模型的训练方式包括:Furthermore, the training method of the gesture recognition model includes:

收集M组手势动作的手势特征向量序列及其对应的手势类型的编码,构成训练数据集;定义时间卷积网络作为手势识别模型的骨干网络,时间卷积网络由h个残差时间卷积块组成,每个残差时间卷积块包括时间卷积层和dropout层,并在时间卷积层和dropout层中加入残差连接;Collect gesture feature vector sequences of M groups of gesture actions and the encoding of their corresponding gesture types to form a training data set; define a temporal convolutional network as the backbone network of the gesture recognition model, the temporal convolutional network consists of h residual temporal convolutional blocks, each residual temporal convolutional block includes a temporal convolutional layer and a dropout layer, and residual connections are added to the temporal convolutional layer and the dropout layer;

时间卷积层的计算公式为:The calculation formula of the temporal convolution layer is:

其中,ys为时间卷积层在时间步s时的输出特征,k为卷积核的大小,i为卷积核在时间维度上的偏移量,xs-i为第s-i个时间步的输入特征,Θ表示卷积操作,wi为卷积核系数,B为偏置项,f()为ReLU函数,f(xs-i)是将输入特征xs-i通过ReLU函数进行变换后的结果; Among them, y s is the output feature of the temporal convolution layer at time step s, k is the size of the convolution kernel, i is the offset of the convolution kernel in the time dimension, x si is the input feature of the si-th time step, Θ represents the convolution operation, wi is the convolution kernel coefficient, B is the bias term, f() is the ReLU function, and f(x si ) is the result of transforming the input feature x si through the ReLU function;

最后一个残差时间卷积块的输出是上下文特征序列,将骨干网络添加一个分类头,将上下文特征序列输入分类头,对上下文特征序列中每个时间步的特征使用全连接层进行分类,得到手势类型的概率分布;The output of the last residual temporal convolution block is a context feature sequence. A classification head is added to the backbone network, and the context feature sequence is input into the classification head. The features of each time step in the context feature sequence are classified using a fully connected layer to obtain the probability distribution of the gesture type.

进行分类的公式为:P(ys|cs)=Softmax(Wql·cs+Bql);其中,Wql为全连接层的权重,Bql为全连接层的偏置,cs为上下文特征序列在时间步s处的特征;The classification formula is: P(y s |c s ) = Softmax(W ql ·c s +B ql ); where W ql is the weight of the fully connected layer, B ql is the bias of the fully connected layer, and cs is the feature of the context feature sequence at time step s;

定义手势识别模型的损失函数其中,S为上下文特征序列的总长度,为第s个时间步的真实的手势类型的编码;Define the loss function of the gesture recognition model Among them, S is the total length of the context feature sequence, is the encoding of the actual gesture type at the s-th time step;

利用训练数据集训练手势识别模型,过程中最小化损失函数,并不断优化手势识别模型的参数,得到训练完成的手势识别模型。The gesture recognition model is trained using the training data set, the loss function is minimized in the process, and the parameters of the gesture recognition model are continuously optimized to obtain a trained gesture recognition model.

进一步地,所述将用户当前交互指令数据进行预处理的方式包括:Furthermore, the method of preprocessing the user's current interaction instruction data includes:

将用户当前交互指令数据中不同模态的数据进行归一化处理,得到归一化指令数据;Normalizing the data of different modes in the user's current interaction instruction data to obtain normalized instruction data;

将归一化指令数据进行时间序列上的对齐,得到对应的多模态序列;将多模态序列在时间维度上拼接,形成一个具有g个特征通道的特征时间序列数据;Align the normalized instruction data in time series to obtain the corresponding multimodal sequence; splice the multimodal sequence in time dimension to form a feature time series data with g feature channels;

将特征时间序列数据构建为一个三维张量,其中两个维度表示时间和特征通道,第三个维度用于表示对应的数据。The feature time series data is constructed as a three-dimensional tensor, where two dimensions represent time and feature channels, and the third dimension is used to represent the corresponding data.

进一步地,所述基于深度强化学习的时间预测模型的构建方式包括:Furthermore, the method of constructing the time prediction model based on deep reinforcement learning includes:

时间预测模型包括序列建模网络和强化学习网络;将门控循环单元网络作为序列建模网络的基础框架,门控循环单元网络包括网络输入层、GRU隐藏层和状态表示输出层;The time prediction model includes a sequence modeling network and a reinforcement learning network. The gated recurrent unit network is used as the basic framework of the sequence modeling network. The gated recurrent unit network includes a network input layer, a GRU hidden layer, and a state representation output layer.

收集N1组的交互序列数据,每个交互序列数据包含时间步特征表示和对应的标签;Collect interaction sequence data of group N1, each interaction sequence data contains time step feature representation and corresponding label;

将交互序列数据按照批次逐步输入至门控循环单元网络得到对应批次的最终状态向量,将对应批次的最终状态向量输入到预设的分类器中得到预测的标签概率的分布;计算标签概率和标签之间的交叉熵损失,对门控循环单元网络和分类器的可训练参数使用优化器进行梯度更新,并最小化交叉熵损失,得到序列建模网络;The interactive sequence data is gradually input into the gated recurrent unit network in batches to obtain the final state vector of the corresponding batch, and the final state vector of the corresponding batch is input into the preset classifier to obtain the distribution of the predicted label probability; the cross entropy loss between the label probability and the label is calculated, and the trainable parameters of the gated recurrent unit network and the classifier are gradient updated using an optimizer, and the cross entropy loss is minimized to obtain a sequence modeling network;

定义强化学习网络为一个半马尔可夫决策过程,为半马尔可夫决策过程定义一个元组(S1,N2,P1,R1);Define the reinforcement learning network as a semi-Markov decision process, and define a tuple (S1, N2, P1, R1) for the semi-Markov decision process;

将半马尔可夫决策过程划分为高层管理器的策略和低层管理器的策略;定义半马尔可夫决策过程的目标是学习一个最优的高层管理器的策略和Q个最优的低层管理器的策略,将交互序列数据通过门控循环单元网络获取的对应批次的最终状态向量,作为半马尔可夫决策过程的状态,训练半马尔可夫决策过程,并使用策略梯度算法分别优化高层管理器的策略和低层管理器的策略;使得在半马尔可夫决策过程中计算的期望累积奖赏最大化;得到构建完成的强化学习网络。The semi-Markov decision process is divided into the strategy of the high-level manager and the strategy of the low-level manager. The goal of the semi-Markov decision process is defined as learning an optimal strategy of the high-level manager and Q optimal strategies of the low-level managers. The final state vector of the corresponding batch obtained by the gated recurrent unit network of the interaction sequence data is used as the state of the semi-Markov decision process. The semi-Markov decision process is trained, and the policy gradient algorithm is used to optimize the strategies of the high-level manager and the low-level manager respectively. The expected cumulative reward calculated in the semi-Markov decision process is maximized. The constructed reinforcement learning network is obtained.

进一步地,所述概率图模型的构建方式包括:Furthermore, the construction method of the probability graph model includes:

定义概率图模型的随机变量,随机变量为相关环境数据中的数据;根据虚拟场景中各个物体之间的相互影响关系,构建无向图结构;无向图结构中的节点表示随机变量,无向图结构中的边表示随机变量之间的相互依赖关系;为每个节点定义一个节点潜在函数,为每条边定义一个边潜在函数;Define random variables of the probabilistic graph model, where the random variables are data in the relevant environmental data; construct an undirected graph structure based on the mutual influence relationship between various objects in the virtual scene; the nodes in the undirected graph structure represent random variables, and the edges in the undirected graph structure represent the mutual dependence relationship between random variables; define a node potential function for each node, and define an edge potential function for each edge;

收集M1组的历史数据,历史数据为虚拟场景状态的时间序列数据;初始化节点潜在函数和边潜在函数的参数,利用虚拟场景状态的时间序列数据对概率图模型进行训练,得到节点潜在函数和边潜在函数的参数;训练的方法为最大似然估计方法;即完成了概率图模型的构建;Collect historical data of group M1, which is the time series data of virtual scene status; initialize the parameters of node potential function and edge potential function, use the time series data of virtual scene status to train the probability graph model, and obtain the parameters of node potential function and edge potential function; the training method is the maximum likelihood estimation method; thus, the construction of the probability graph model is completed;

所述未来n个虚拟场景状态的获取方式包括:The method of obtaining the future n virtual scene states includes:

定义概率图模型的转移概率,基于概率图模型的转移概率,对未来n个时间步长进行推理,得到每个时间步长下虚拟场景各个物体的概率分布,在进行推理过程中,将用户交互序列按时间步长依次输入概率图模型;Define the transition probability of the probabilistic graphical model, and based on the transition probability of the probabilistic graphical model, infer the next n time steps to obtain the probability distribution of each object in the virtual scene at each time step. During the inference process, input the user interaction sequence into the probabilistic graphical model in sequence according to the time step;

对于每个时间步长,根据概率分布采样或选取场景物体的状态,构建出该时间步长下的虚拟场景状态,继而得到未来n个虚拟场景状态。For each time step, the state of the scene objects is sampled or selected according to the probability distribution to construct the virtual scene state at that time step, and then the future n virtual scene states are obtained.

一种虚拟场景交互系统,用于实现所述的一种虚拟场景交互方法,包括:数据采集处理模块,用于获取用户当前交互指令数据和相关环境数据,将用户当前交互指令数据进行预处理,得到融合交互特征序列;A virtual scene interaction system, used to implement the virtual scene interaction method, comprising: a data acquisition and processing module, used to obtain the user's current interaction instruction data and related environment data, and pre-process the user's current interaction instruction data to obtain a fused interaction feature sequence;

预测模块,用于将融合交互特征序列输入至预先构建完成的基于深度强化学习的时间预测模型,得到一个未来时间段内的用户交互序列;The prediction module is used to input the fused interaction feature sequence into a pre-built time prediction model based on deep reinforcement learning to obtain a user interaction sequence in a future time period;

虚拟环境调控模块,用于根据相关环境数据和用户交互序列,利用预先构建完成的概率图模型,得到未来n个虚拟场景状态;基于未来n个虚拟场景状态渲染出对应的虚拟场景画面,将虚拟场景画面传输至用户端设备,各个模块之间通过有线和/或无线的方式进行连接。The virtual environment control module is used to obtain n future virtual scene states based on relevant environmental data and user interaction sequences using a pre-built probabilistic graph model; render corresponding virtual scene images based on the n future virtual scene states, and transmit the virtual scene images to the user-end device. The modules are connected via wired and/or wireless means.

本发明一种虚拟场景交互方法和系统的技术效果和优点:Technical effects and advantages of a virtual scene interaction method and system of the present invention:

本发明能够融合多种用户交互数据,如按键、手势、眼球运动等,特别的对于虚拟交互来说手势数据的准确性较为重要,全面捕捉用户的交互意图,从而更准确地预测用户的行为,提升了交互的智能性,其次,采用基于深度强化学习的时间预测模型,能够提前预测用户未来的交互行为序列,并驱动概率图模型生成未来虚拟场景的状态变化,大大增强了交互的流畅性和自然性,此外,还利用概率图模型建模虚拟场景的上下文环境,如物体位置、光照条件等,更好地预测场景的变化,从而进一步提高了交互的准确性,总的来说,通过多模态融合、时间预测建模和概率图建模,大幅提升了用户的交互体验。The present invention can integrate multiple user interaction data, such as buttons, gestures, eye movements, etc., especially for virtual interaction, the accuracy of gesture data is more important, which can fully capture the user's interaction intention, thereby more accurately predicting the user's behavior and improving the intelligence of the interaction. Secondly, the time prediction model based on deep reinforcement learning can predict the user's future interaction behavior sequence in advance, and drive the probabilistic graph model to generate the state changes of future virtual scenes, which greatly enhances the fluency and naturalness of the interaction. In addition, the probabilistic graph model is used to model the contextual environment of the virtual scene, such as object position, lighting conditions, etc., to better predict the changes in the scene, thereby further improving the accuracy of the interaction. In general, through multimodal fusion, time prediction modeling and probabilistic graph modeling, the user's interaction experience is greatly improved.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本发明的一种虚拟场景交互方法示意图;FIG1 is a schematic diagram of a virtual scene interaction method of the present invention;

图2为本发明的一种虚拟场景交互系统示意图。FIG. 2 is a schematic diagram of a virtual scene interaction system of the present invention.

具体实施方式DETAILED DESCRIPTION

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

实施例1Example 1

请参阅图1所示,本实施例一种虚拟场景交互方法,包括:Referring to FIG. 1 , a virtual scene interaction method according to this embodiment includes:

S1、获取用户当前交互指令数据和相关环境数据,将用户当前交互指令数据进行预处理,得到融合交互特征序列;S1. Obtain the user's current interaction instruction data and related environment data, pre-process the user's current interaction instruction data, and obtain a fused interaction feature sequence;

S2、将融合交互特征序列输入至预先构建完成的基于深度强化学习的时间预测模型,得到一个未来时间段内的用户交互序列;S2. Input the fused interaction feature sequence into the pre-built time prediction model based on deep reinforcement learning to obtain a user interaction sequence in a future time period;

S3、根据相关环境数据和用户交互序列,利用预先构建完成的概率图模型,得到未来n个虚拟场景状态;基于未来n个虚拟场景状态渲染出对应的虚拟场景画面,将虚拟场景画面传输至用户端设备。S3. According to the relevant environmental data and the user interaction sequence, the pre-built probabilistic graph model is used to obtain the future n virtual scene states; based on the future n virtual scene states, the corresponding virtual scene images are rendered, and the virtual scene images are transmitted to the user terminal device.

进一步的,用户当前交互指令数据包括用户输入设备操作数据和生物特征数据;Furthermore, the user's current interaction instruction data includes user input device operation data and biometric data;

用户输入设备操作数据包括按键数据、手势数据和设备位移数据;生物特征数据包括眼球运动数据和肢体运动数据;User input device operation data includes key data, gesture data, and device displacement data; biometric data includes eye movement data and limb movement data;

相关环境数据包括用户所处虚拟位置数据、视角方向数据和用户所处环境状态数据;用户所处环境状态数据包括场景物体位置数据和光照数据;The relevant environment data includes the user's virtual position data, viewing direction data and the user's environment state data; the user's environment state data includes scene object position data and lighting data;

按键数据包括按键事件的时间戳、按键编码和扫描码,需要说明的是,时间戳由输入设备的操作系统内核或驱动程序在收到硬件中断时获取,例如,当用户按下按键时,键盘硬件会触发一个中断信号,操作系统内核或键盘驱动程序收到该中断,内核或驱动程序调用系统时间API,获取当前的系统时间,精确到微秒或纳秒级别,获取到的时间值就是按键事件发生的时间戳。The key data includes the timestamp, key code and scan code of the key event. It should be noted that the timestamp is obtained by the operating system kernel or driver of the input device when it receives a hardware interrupt. For example, when the user presses a key, the keyboard hardware triggers an interrupt signal. The operating system kernel or keyboard driver receives the interrupt, and the kernel or driver calls the system time API to obtain the current system time, accurate to the microsecond or nanosecond level. The obtained time value is the timestamp of the key event.

按键编码由输入设备的键盘驱动程序根据扫描码查询按键映射表获得;扫描码来自输入设备的键盘硬件电路,具体的,键盘硬件电路由多个按键矩阵组成,每个按键对应矩阵中的一个行列交点,当按下一个按键时,对应的行列交点会形成电路通路,键盘硬件电路检测到这个通路,并根据行列位置生成一个硬件扫描码,即扫描码。The key code is obtained by the keyboard driver of the input device by querying the key mapping table according to the scan code; the scan code comes from the keyboard hardware circuit of the input device. Specifically, the keyboard hardware circuit is composed of multiple key matrices, and each key corresponds to a row and column intersection in the matrix. When a key is pressed, the corresponding row and column intersection will form a circuit path. The keyboard hardware circuit detects this path and generates a hardware scan code, i.e., the scan code, according to the row and column positions.

时间戳、按键编码和扫描码结合起来就完整描述了一个按键事件,例如,按下“A”键时,记录数据[12:30:45.782,65,30]。The timestamp, key code, and scan code together fully describe a key event. For example, when the "A" key is pressed, the data [12:30:45.782, 65, 30] is recorded.

手势数据的获取方式包括:The methods for obtaining gesture data include:

采用深度相机以固定的帧率(如30fps)持续采集用户手部区域的点云数据,构成点云数据序列;深度相机采集的手部区域的点云数据不是仅仅包含手部还存在一些背景区域;A depth camera is used to continuously collect point cloud data of the user's hand area at a fixed frame rate (such as 30fps) to form a point cloud data sequence; the point cloud data of the hand area collected by the depth camera does not only contain the hand but also some background areas;

从点云数据序列中提取手部精确点云数据,将手部区域点云数据进行降采样,减少数据量,提高后续处理效率,得到完整手部点云数据。The precise point cloud data of the hand is extracted from the point cloud data sequence, and the point cloud data of the hand area is downsampled to reduce the data volume, improve the subsequent processing efficiency, and obtain complete point cloud data of the hand.

进行降采样的方式包括:Ways to downsample include:

将点云数据序列有序地插入到预先构建完成的八叉树中,然后以固定的空间分辨率对八叉树进行遍历,得到完整手部点云数据。The point cloud data sequence is inserted into the pre-built octree in an orderly manner, and then the octree is traversed at a fixed spatial resolution to obtain the complete hand point cloud data.

八叉树的构建方式包括:The construction of the octree includes:

将点云数据序列所在的三维空间划分为规则的立方体单元,根据点云数据序列中点的坐标,将每个点插入到对应的立方体单元中,对于包含m个点的立方体单元,将其继续递归划分为8个子单元,直到每个立方体单元内最多只有一个点,即初步完成八叉树的构建。The three-dimensional space where the point cloud data sequence is located is divided into regular cubic units. According to the coordinates of the points in the point cloud data sequence, each point is inserted into the corresponding cubic unit. For a cubic unit containing m points, it is further recursively divided into 8 sub-units until there is at most one point in each cubic unit, that is, the construction of the octree is preliminarily completed.

对八叉树进行遍历的方式包括:The ways to traverse the octree include:

设置一个距离阈值d,表示相邻两个采样的点之间的最小距离,d的值越大,采样点越稀疏,d的值越小,采样点越密集;Set a distance threshold d, which represents the minimum distance between two adjacent sampled points. The larger the value of d, the sparser the sampled points are, and the smaller the value of d, the denser the sampled points are.

从八叉树的根节点开始,按照深度优先或广度优先的遍历八叉树的每个节点,对于每个非空的节点(包含点云点),计算节点中所有点到节点中心的距离,选取距离节点中心最近的点作为该节点的代表点。Starting from the root node of the octree, traverse each node of the octree in a depth-first or breadth-first manner. For each non-empty node (including point cloud points), calculate the distance from all points in the node to the center of the node, and select the point closest to the center of the node as the representative point of the node.

在八叉树中,深度优先为从根节点开始,选择一个子节点,继续向下遍历该子节点的子节点,直到遇到叶子节点或空节点,然后回溯到上一层节点,继续遍历其他子节点。In an octree, depth-first traversal starts from the root node, selects a child node, and continues to traverse the child nodes of the child node downward until a leaf node or an empty node is encountered, then backtracks to the previous node and continues to traverse other child nodes.

在八叉树中,广度优先是从根节点开始,先访问根节点,然后依次访问所有第一层节点,再访问所有第二层节点,以此类推。In an octree, breadth-first access starts from the root node, visits the root node first, then visits all first-layer nodes in sequence, then visits all second-layer nodes, and so on.

节点中心指的是该立方体空间区域的几何中心,在遍历八叉树进行降采样时,对于每个非空节点(包含点云点),需要计算该节点中所有点云点到节点中心的距离,然后选取距离最近的那个点云点作为该节点的代表点;这样做的目的是为了在降采样时,保留对该区域最有代表性的点云点。The node center refers to the geometric center of the cubic space area. When traversing the octree for downsampling, for each non-empty node (including point cloud points), it is necessary to calculate the distance from all point cloud points in the node to the node center, and then select the point cloud point with the nearest distance as the representative point of the node; the purpose of this is to retain the most representative point cloud points for the area during downsampling.

初始化一个空的列表L,用于存储采样点,遍历八叉树的每个非空的节点X,计算X的中心点c和代表点p之间的距离d(c,p),若d(c,p)大于或等于d,则将p加入列表L,最终列表L中的点即为完整手部点云数据;Initialize an empty list L to store sampling points, traverse each non-empty node X of the octree, calculate the distance d(c,p) between the center point c of X and the representative point p, if d(c,p) is greater than or equal to d, then add p to the list L, and finally the points in the list L are the complete hand point cloud data;

其中,距离d(c,p)的计算公式为:Among them, the calculation formula of distance d(c,p) is:

其中,(cx,cy,cz)为中心点c的三维坐标,(px,py,pz)为代表点p的三维坐标。 Among them, (c x , cy ,c z ) are the three-dimensional coordinates of the center point c, and (p x , py ,p z ) are the three-dimensional coordinates of the representative point p.

将完整手部点云数据进行特征提取,得到手掌法向量、指尖位置向量、指根位置向量和指间角度向量;将手掌法向量、指尖位置向量、指根位置向量和指间角度向量拼接得到手势特征向量。The complete hand point cloud data is subjected to feature extraction to obtain the palm normal vector, fingertip position vector, finger base position vector and inter-finger angle vector; the palm normal vector, fingertip position vector, finger base position vector and inter-finger angle vector are concatenated to obtain the gesture feature vector.

进行特征提取的方式包括:Methods for feature extraction include:

将完整手部点云数据进行主成分分析(PCA),得到主方向向量手掌法向量为与手部所在的三维坐标系的z轴负方向的矢量积,即其中,为z轴的单位向量(0,0,1)。Perform principal component analysis (PCA) on the complete hand point cloud data to obtain the main direction vector Palm normal vector for The vector product of the negative z-axis direction of the three-dimensional coordinate system where the hand is located, that is, in, is the unit vector of the z-axis (0, 0, 1).

将完整手部点云数据构造成集合P,基于集合P构造完整的凸壳CH(P);The complete hand point cloud data is constructed into a set P, and a complete convex hull CH(P) is constructed based on the set P;

凸壳CH(P)的构造方式包括:The construction methods of convex hull CH(P) include:

初始时,凸壳CH(P)为任意4个不共面的点构成的四面体,对于集合P中的点b,若b在CH(P)内,则忽略b,若b在CH(P)上,则将b添加到CH(P)的顶点集合,若b在CH(P)外,则用b对CH(P)进行遍历划分,生成新的CH(P),最终得到完整的CH(P)。Initially, the convex hull CH(P) is a tetrahedron composed of any four non-coplanar points. For a point b in the set P, if b is in CH(P), then b is ignored; if b is on CH(P), then b is added to the vertex set of CH(P); if b is outside CH(P), then b is used to traverse and divide CH(P) to generate a new CH(P), and finally a complete CH(P) is obtained.

对完整的CH(P)进行层次聚类,得到k+1个层次,记作L0,L1,...,Lk-1,Lk;其中,Lk-1即为指尖点集;Perform hierarchical clustering on the complete CH(P) to obtain k+1 levels, denoted as L0, L1, ..., Lk-1, Lk; where Lk-1 is the fingertip point set;

对Lk-1中的每个点vj,遍历CH(P)上的所有顶点,计算vj到所有顶点的欧几里得距离并取最小值dj,计算完所有vj的dj后,取dj的最小值对应的点,即为指尖位置,将指尖位置进行向量化,即得到指尖位置向量其中,t为手指的索引。For each point vj in Lk-1, traverse all vertices on CH(P), calculate the Euclidean distance from vj to all vertices and take the minimum value dj. After calculating the dj of all vj, take the point corresponding to the minimum value of dj, which is the fingertip position. Vectorize the fingertip position to get the fingertip position vector Where t is the index of the finger.

进行层次聚类的方式包括:Ways to perform hierarchical clustering include:

初始化L0等于CH(P),对于每一个层次Lr,r属于区间[0,k],且k为大于1的正整数;计算Lr中所有点对(vp,vq)的欧几里得距离d(vp,vq),提取最大的欧几里得距离对应的点对(p i,pj),将(p i,pj)合并为一个新的簇,移除pi和pj,将剩余的点和新的簇组成新的点集Lr+1;重复直至Lr+1为空集或只包含一个簇,即完成了对完整的CH(P)的层次聚类。Initialize L0 equal to CH(P). For each level Lr, r belongs to the interval [0, k], and k is a positive integer greater than 1. Calculate the Euclidean distance d(vp, vq) of all point pairs (vp, vq) in Lr, extract the point pair (pi, pj) corresponding to the largest Euclidean distance, merge (pi, pj) into a new cluster, remove pi and pj, and form a new point set Lr+1 with the remaining points and the new cluster. Repeat until Lr+1 is an empty set or contains only one cluster, and the hierarchical clustering of the complete CH(P) is completed.

计算每个指尖位置向量到手掌平面的距离dt,沿手掌平面的法线方向从往回偏移α得到对应指根位置向量其中,α为经验系数,通常是0到1之间的一个小数,它反映了手指长度占整个手部长度的比例。Calculate the position vector of each fingertip Distance dt to the palm plane, along the normal to the palm plane Direction from Shift back α to get the corresponding root position vector Among them, α is an empirical coefficient, usually a decimal between 0 and 1, which reflects the proportion of finger length to the entire hand length.

对于任意两相邻的指尖位置向量和计算的矢量和的矢量其中,为t+1手指对应的指根位置向量;For any two adjacent fingertip position vectors and calculate Vector and Vector in, is the finger root position vector corresponding to the t+1 finger;

则基于矢量和计算得到指间角度将指间角度向量化,即得到指间角度向量。Based on vector and Calculate the finger angle The inter-finger angle is vectorized to obtain the inter-finger angle vector.

将获得的手势特征向量按照时间的先后排列成一个手势特征向量序列,将手势特征向量序列输入至预先训练完成的手势识别模型中,输出对应的手势类型的概率分布,取概率分布中概率最大的手势类型的编码作为手势数据,如编码6代表“挥手”手势。The obtained gesture feature vectors are arranged into a gesture feature vector sequence in chronological order, and the gesture feature vector sequence is input into a pre-trained gesture recognition model, and the probability distribution of the corresponding gesture type is output. The code of the gesture type with the largest probability in the probability distribution is taken as the gesture data, such as code 6 represents the "waving" gesture.

手势识别模型的训练方式包括:The training methods of gesture recognition model include:

收集M组手势动作的手势特征向量序列及其对应的手势类型的编码,构成训练数据集;定义时间卷积网络作为手势识别模型的骨干网络,时间卷积网络由h个残差时间卷积块组成,每个残差时间卷积块包括时间卷积层和dropout层,并在时间卷积层和dropout层中加入残差连接,加入dropout层防止过拟合,加入残差连接,有助于梯度传播。Collect gesture feature vector sequences of M groups of gesture actions and the encoding of their corresponding gesture types to form a training data set; define a temporal convolutional network as the backbone network of the gesture recognition model. The temporal convolutional network consists of h residual temporal convolutional blocks. Each residual temporal convolutional block includes a temporal convolutional layer and a dropout layer, and residual connections are added to the temporal convolutional layer and the dropout layer. Adding a dropout layer prevents overfitting, and adding a residual connection helps gradient propagation.

时间卷积层的计算公式为:The calculation formula of the temporal convolution layer is:

其中,ys为时间卷积层在时间步s时的输出特征,k为卷积核的大小,i为卷积核在时间维度上的偏移量,范围是0到k-1,xs-i为第s-i个时间步的输入特征,Θ表示卷积操作,wi为卷积核系数,B为偏置项,f()为ReLU函数,f(xs-i)是将输入特征xs-i通过ReLU函数进行变换后的结果; Among them, ys is the output feature of the temporal convolution layer at time step s, k is the size of the convolution kernel, i is the offset of the convolution kernel in the time dimension, ranging from 0 to k-1, xsi is the input feature of the si-th time step, Θ represents the convolution operation, wi is the convolution kernel coefficient, B is the bias term, f() is the ReLU function, and f( xsi ) is the result of transforming the input feature xsi through the ReLU function;

最后一个残差时间卷积块的输出是上下文特征序列,将骨干网络添加一个分类头,将上下文特征序列输入分类头,对上下文特征序列中每个时间步的特征使用全连接层进行分类,得到手势类型的概率分布。The output of the last residual temporal convolution block is a context feature sequence. A classification head is added to the backbone network, and the context feature sequence is input into the classification head. The features of each time step in the context feature sequence are classified using a fully connected layer to obtain the probability distribution of the gesture type.

进行分类的公式为:P(ys|cs)=Soft max(Wql·cs+Bql);其中,Wql为全连接层的权重,Bql为全连接层的偏置,cs为上下文特征序列在时间步s处的特征;The classification formula is: P(y s |c s ) = Soft max(W ql ·c s +B ql ); where W ql is the weight of the fully connected layer, B ql is the bias of the fully connected layer, and c s is the feature of the context feature sequence at time step s;

定义手势识别模型的损失函数其中,S为上下文特征序列的总长度,即时间步的总数,为第s个时间步的真实的手势类型的编码;Define the loss function of the gesture recognition model Among them, S is the total length of the context feature sequence, that is, the total number of time steps, is the encoding of the actual gesture type at the s-th time step;

利用训练数据集训练手势识别模型,过程中最小化损失函数,并不断优化手势识别模型的参数,得到训练完成的手势识别模型。The gesture recognition model is trained using the training data set, the loss function is minimized in the process, and the parameters of the gesture recognition model are continuously optimized to obtain a trained gesture recognition model.

通过设备内置的加速度传感器或陀螺仪传感器检测设备的运动状态,运动状态包括位移和旋转,通过融合数据,获取设备位移数据。The motion state of the device is detected by the built-in acceleration sensor or gyroscope sensor of the device. The motion state includes displacement and rotation. The device displacement data is obtained by fusing the data.

眼球运动数据通过设备的前置摄像头结合眼球追踪算法来获取,眼球追踪算法包括基于图像处理的算法或基于3D模型的算法,图像处理的算法或基于3D模型的算法可以实时检测用户的眼部运动轨迹。Eye movement data is obtained through the front camera of the device in combination with an eye tracking algorithm. The eye tracking algorithm includes an image processing-based algorithm or a 3D model-based algorithm. The image processing algorithm or the 3D model-based algorithm can detect the user's eye movement trajectory in real time.

肢体运动数据通过设备的深度摄像头或RGB摄像头,结合骨骼跟踪算法来获取;骨骼跟踪算法基于机器学习模型,从图像或视频中检测并跟踪人体关键点,从而获取肢体的运动轨迹数据。Limb motion data is obtained through the device's depth camera or RGB camera combined with a skeleton tracking algorithm; the skeleton tracking algorithm is based on a machine learning model that detects and tracks key points of the human body from images or videos to obtain limb motion trajectory data.

相关环境数据通过虚拟场景的三维模型数据获取,具体的,在构建虚拟场景时,对场景中的人物和各个物体进行三维建模,并记录它们的精确位置坐标、用户所处虚拟位置数据和视角方向数据,通过设置虚拟场景的光照参数获取光照数据。The relevant environmental data is obtained through the three-dimensional model data of the virtual scene. Specifically, when constructing the virtual scene, the characters and objects in the scene are three-dimensionally modeled, and their precise position coordinates, the user's virtual position data and viewing direction data are recorded, and the lighting data is obtained by setting the lighting parameters of the virtual scene.

需要说明的是,将上述数据均进行了量化,使得适应于后续的数据处理。It should be noted that the above data are all quantified to make them suitable for subsequent data processing.

进一步的,将用户当前交互指令数据进行预处理的方式包括:Furthermore, the method of preprocessing the user's current interaction instruction data includes:

将用户当前交互指令数据中不同模态的数据进行归一化处理,得到归一化指令数据,使其数值范围处于相同的量级;归一化方法包括Min-Max归一化和Z-Score归一化。The data of different modes in the user's current interaction command data are normalized to obtain normalized command data so that their numerical ranges are at the same order of magnitude; the normalization methods include Min-Max normalization and Z-Score normalization.

将归一化指令数据进行时间序列上的对齐,使得不同模态在同一时间点都有对应的数据,得到对应的多模态序列,使用插值、上采样或下采样实现对齐。The normalized instruction data is aligned in time series so that different modes have corresponding data at the same time point, and the corresponding multimodal sequence is obtained. Interpolation, upsampling or downsampling is used to achieve alignment.

将多模态序列在时间维度上拼接,形成一个具有g个特征通道的特征时间序列数据;例如,按键数据、手势数据、眼球运动数据并列形成多个特征通道,这种拼接融合方式保留了每个模态的原始时间动态,易于后续建模;The multimodal sequences are spliced in the time dimension to form a feature time series data with g feature channels; for example, key data, gesture data, and eye movement data are parallel to form multiple feature channels. This splicing and fusion method retains the original time dynamics of each modality and is easy for subsequent modeling;

将特征时间序列数据构建为一个三维张量,其中两个维度表示时间和特征通道,第三个维度用于表示对应的数据;便于输入到能够处理多通道数据的模型中。The feature time series data is constructed as a three-dimensional tensor, in which two dimensions represent time and feature channels, and the third dimension is used to represent the corresponding data; it is convenient to input into the model that can process multi-channel data.

将已量化的多模态的数据进行有效融合,为后续的特征提取和建模过程做好数据准备。Effectively fuse the quantified multimodal data to prepare data for subsequent feature extraction and modeling processes.

进一步的,基于深度强化学习的时间预测模型的构建方式包括:Furthermore, the construction methods of the time prediction model based on deep reinforcement learning include:

定义时间预测模型包括序列建模网络和强化学习网络;将门控循环单元网络作为序列建模网络的基础框架,门控循环单元网络包括网络输入层、GRU隐藏层和状态表示输出层。The time prediction model is defined to include a sequence modeling network and a reinforcement learning network. The gated recurrent unit network is used as the basic framework of the sequence modeling network, and the gated recurrent unit network includes a network input layer, a GRU hidden layer, and a state representation output layer.

收集N1组的交互序列数据,每个交互序列数据包含时间步特征表示和对应的标签(用户的最终行为);Collect interaction sequence data of group N1. Each interaction sequence data contains time step feature representation and corresponding label (the user's final behavior).

将交互序列数据按照批次逐步输入至门控循环单元网络得到对应批次的最终状态向量,将对应批次的最终状态向量输入到预设的分类器中(全连接层+softmax函数)得到预测的标签概率的分布;计算标签概率和标签之间的交叉熵损失,对门控循环单元网络和分类器的可训练参数使用优化器(如Adam)进行梯度更新,并最小化交叉熵损失,得到训练完成的门控循环单元网络。The interaction sequence data is gradually input into the gated recurrent unit network in batches to obtain the final state vector of the corresponding batch, and the final state vector of the corresponding batch is input into the preset classifier (fully connected layer + softmax function) to obtain the distribution of predicted label probabilities; the cross entropy loss between label probabilities and labels is calculated, and the trainable parameters of the gated recurrent unit network and classifier are gradient updated using an optimizer (such as Adam), and the cross entropy loss is minimized to obtain a trained gated recurrent unit network.

网络输入层用于接收融合交互特征序列作为输入,融合交互特征序列是一个长度为Y的向量序列,向量序列中的每个向量对应一个时间步;The network input layer is used to receive the fused interaction feature sequence as input. The fused interaction feature sequence is a vector sequence with a length of Y, and each vector in the vector sequence corresponds to a time step;

GRU隐藏层由F个GRU单元组成,每个GRU单元对应处理向量序列中的一个时间步;对于第a个时间步,利用当前时间步的输入向量和上一时间步的隐状态向量,计算出一个更新门控制器向量,更新门控制器向量的每个元素值在0到1之间,表示对应的隐状态元素应当保留来自上一状态的信息的程度。The GRU hidden layer consists of F GRU units, each of which corresponds to a time step in the processing vector sequence; for the a-th time step, an update gate controller vector is calculated using the input vector of the current time step and the hidden state vector of the previous time step. Each element value of the update gate controller vector is between 0 and 1, indicating the degree to which the corresponding hidden state element should retain information from the previous state.

同样利用当前时间步的输入向量和上一时间步的隐状态向量,计算出一个重置门控制器向量;重置门控制器向量的每个元素值在0到1之间,表示对应的隐状态元素应当舍弃来自上一状态的信息的程度;Similarly, a reset gate controller vector is calculated using the input vector of the current time step and the hidden state vector of the previous time step; each element value of the reset gate controller vector is between 0 and 1, indicating the degree to which the corresponding hidden state element should discard the information from the previous state;

根据当前输入向量、重置门控制器向量和上一时间步的隐状态向量,计算出一个候选新隐状态向量;候选新隐状态向量综合了来自当前输入和上一状态的信息。Based on the current input vector, the reset gate controller vector and the hidden state vector of the previous time step, a candidate new hidden state vector is calculated; the candidate new hidden state vector integrates the information from the current input and the previous state.

利用更新门控制器向量、上一时间步的隐状态向量和候选新隐状态向量,计算出当前时间步的最终隐状态向量;最终隐状态向量是对上一隐状态和候选新隐状态的融合,由更新门控制器决定两者的融合比例。The final hidden state vector of the current time step is calculated using the update gate controller vector, the hidden state vector of the previous time step, and the candidate new hidden state vector; the final hidden state vector is a fusion of the previous hidden state and the candidate new hidden state, and the update gate controller determines the fusion ratio of the two.

状态表示输出层经过Y个时间步的递归计算,得到最后一个时间步的隐状态向量,将该向量作为整个融合交互特征序列的编码表示,即得到最终状态向量。The state representation output layer is recursively calculated for Y time steps to obtain the hidden state vector of the last time step, which is used as the encoding representation of the entire fused interaction feature sequence, that is, the final state vector.

需要解释的是,隐状态向量是GRU单元在每个时间步保存的一个向量,用于编码来自之前时间步的输入序列的信息,具体来说,在第a个时间步,GRU单元会根据当前时间步的输入向量x(a)和上一时间步的隐状态向量h(a-1)来计算更新门控制器向量z(a),更新门控制器向量每个元素的值在0到1之间,用于控制该时间步的隐状态向量h(a)应当保留来自上一隐状态h(a-1)的信息的程度,同样重置门控制器向量、候选新隐状态向量和最终状态向量亦是如此获取。It should be explained that the hidden state vector is a vector saved by the GRU unit at each time step, which is used to encode information from the input sequence of the previous time step. Specifically, at the ath time step, the GRU unit will calculate the update gate controller vector z(a) based on the input vector x(a) of the current time step and the hidden state vector h(a-1) of the previous time step. The value of each element of the updated gate controller vector is between 0 and 1, which is used to control the extent to which the hidden state vector h(a) of this time step should retain information from the previous hidden state h(a-1). Similarly, the reset gate controller vector, candidate new hidden state vector and final state vector are also obtained in this way.

更新门控制器向量z(a)是上一隐状态h(a-1)和当前输入x(a)的函数,通过学习得到的权重矩阵W(z)和偏置b(z)对它们进行affi ne变换,再通过s igmo id激活函数得到0到1之间的值;The update gate controller vector z(a) is a function of the previous hidden state h(a-1) and the current input x(a). They are affixed using the learned weight matrix W(z) and bias b(z), and then activated using the sigmoid activation function to obtain a value between 0 and 1.

z(a)的每个元素值接近0,表示该元素在新的隐状态h(a)中应当较多保留来自上一隐状态h(a-1)的信息;反之,值接近1,表示该元素应当较多融入来自当前输入x(a)的新信息。The value of each element of z(a) is close to 0, which means that the element should retain more information from the previous hidden state h(a-1) in the new hidden state h(a); conversely, the value is close to 1, which means that the element should incorporate more new information from the current input x(a).

所以,隐状态向量h(a-1)不仅携带着之前时间步的序列信息,还通过更新门控制器向量z(a)控制了新的隐状态h(a)应当如何更新,以此来编码整个输入序列的动态信息。Therefore, the hidden state vector h(a-1) not only carries the sequence information of the previous time step, but also controls how the new hidden state h(a) should be updated by updating the gate controller vector z(a), thereby encoding the dynamic information of the entire input sequence.

强化学习网络的构建方式包括:The reinforcement learning network is constructed in the following ways:

定义强化学习网络为一个半马尔可夫决策过程,为半马尔可夫决策过程定义一个元组(S1,N2,P1,R1);其中,S1是低层管理器的决策的状态空间,N2是高层管理器可选择的子任务空间,P1是低层管理器的决策的状态转移函数,P(s'|s1,n1,π_n)表示在状态s1下,执行子任务n1对应的策略π_n后,转移到状态s'的概率,R1是低层管理器的决策的奖赏函数,R(s1,n1,π_n)表示在状态s1下,执行子任务n1对应的策略π_n所获得的奖赏。Define the reinforcement learning network as a semi-Markov decision process, and define a tuple (S1, N2, P1, R1) for the semi-Markov decision process; where S1 is the state space of the decision of the low-level manager, N2 is the subtask space that the high-level manager can choose, P1 is the state transition function of the decision of the low-level manager, P(s'|s1, n1, π_n) represents the probability of transferring to state s' after executing the strategy π_n corresponding to subtask n1 in state s1, R1 is the reward function of the decision of the low-level manager, and R(s1, n1, π_n) represents the reward obtained by executing the strategy π_n corresponding to subtask n1 in state s1.

将半马尔可夫决策过程划分为高层管理器的策略和低层管理器的策略;高层管理器的策略π_m(n1|s1)表示在状态s1下选择子任务n1的概率,低层管理器的策略π_n(a1|s1)表示在状态s1下,执行子任务n1时选择动作a1的概率。The semi-Markov decision process is divided into the strategy of the high-level manager and the strategy of the low-level manager; the strategy π_m(n1|s1) of the high-level manager represents the probability of selecting subtask n1 in state s1, and the strategy π_n(a1|s1) of the low-level manager represents the probability of selecting action a1 when executing subtask n1 in state s1.

定义半马尔可夫决策过程的目标是学习一个最优的高层管理器的策略和Q个最优的低层管理器的策略,将交互序列数据通过门控循环单元网络获取的对应批次的最终状态向量,作为半马尔可夫决策过程的状态,训练半马尔可夫决策过程,并使用策略梯度算法分别优化高层管理器的策略和低层管理器的策略;使得在半马尔可夫决策过程中获得的期望累积奖赏最大化;得到构建完成的强化学习网络。The goal of defining a semi-Markov decision process is to learn an optimal high-level manager strategy and Q optimal low-level manager strategies. The final state vector of the corresponding batch obtained by the gated recurrent unit network through the interaction sequence data is used as the state of the semi-Markov decision process. The semi-Markov decision process is trained, and the policy gradient algorithm is used to optimize the high-level manager strategy and the low-level manager strategy respectively; the expected cumulative reward obtained in the semi-Markov decision process is maximized; and the reinforcement learning network is constructed.

期望累积奖赏的计算公式为:The calculation formula for expected cumulative rewards is:

其中,J(πm,{πn})表示在给定高层管理器的策略πm和低层管理器的策略构成的集合{πn}时,期望获得的累积奖赏,是需最大化的目标函数;表示对轨迹τ取期望值,其中轨迹τ是根据高层管理器的策略πm和低层管理器的策略构成的集合{πn}生成,CD为最终状态向量的时间步的数量,cd为最终状态向量的时间步索引,γcd为时间步cd时的折现因子,表示在状态scd下,执行子任务ncd对应的低层管理器的策略所获得的即时奖赏,scd为时间步cd时的状态,ncd表示时间步cd执行的子任务,由高层管理器的策略选择,表示执行子任务ncd时采用的低层管理器的策略。 Where J(π m ,{π n }) represents the expected cumulative reward when given the strategy π m of the high-level manager and the set {π n } of the strategies of the low-level managers, which is the objective function to be maximized; represents the expected value of the trajectory τ, where the trajectory τ is generated according to the set {π n } consisting of the strategies of the high-level manager π m and the strategies of the low-level managers, CD is the number of time steps of the final state vector, cd is the time step index of the final state vector, γ cd is the discount factor at time step cd, Indicates the strategy of the lower-level manager corresponding to the execution of subtask n cd in state s cd The immediate reward obtained, s cd is the state at time step cd, n cd represents the subtask executed at time step cd, which is selected by the strategy of the high-level manager, Indicates the strategy of the lower-level manager used when executing subtask n cd .

需要说明的是,在半马尔可夫决策过程中,存在高层管理器(高级策略)和低层管理器(低级策略)两个层次,高层管理器决定选择执行哪个子任务,而低层管理器则决定如何执行该子任务(执行哪些具体动作);轨迹的生成方式包括:It should be noted that in the semi-Markov decision process, there are two levels: high-level managers (high-level strategies) and low-level managers (low-level strategies). The high-level manager decides which subtask to execute, while the low-level manager decides how to execute the subtask (which specific actions to perform). The generation of trajectories includes:

初始化初始的状态s0,该状态由门控循环单元网络获取的最终状态向量表示;根据当前状态和高层管理器的策略选择一个子任务nt。具体做法是从策略的概率分布中采样一个子任务;根据当前状态和选择的子任务nt,利用对应的低层管理器的策略执行该子任务,即根据低层管理器的策略的概率分布连续采样动作序列,直到子任务完成或达到最大步数限制;执行子任务过程中,记录所经历的状态序列、执行的动作序列,以及获得的即时奖励;子任务执行完毕后,根据状态转移函数,从当前状态转移到下一状态;重复直到达到终止条件(如最大轨迹长度);通过以上过程,就生成了一条完整的轨迹τ,包含了状态序列、子任务序列、动作序列和奖励序列。Initialize the initial state s0, which is represented by the final state vector obtained by the gated recurrent unit network; select a subtask nt according to the current state and the strategy of the high-level manager. The specific method is to sample a subtask from the probability distribution of the strategy; according to the current state and the selected subtask nt, use the corresponding low-level manager's strategy to execute the subtask, that is, continuously sample the action sequence according to the probability distribution of the low-level manager's strategy until the subtask is completed or the maximum step limit is reached; during the execution of the subtask, record the state sequence experienced, the action sequence executed, and the immediate reward obtained; after the subtask is executed, transfer from the current state to the next state according to the state transfer function; repeat until the termination condition (such as the maximum trajectory length) is reached; through the above process, a complete trajectory τ is generated, which includes the state sequence, subtask sequence, action sequence and reward sequence.

将用户交互过程分解为多个子任务,由高层管理器选择当前要执行哪个子任务,而低层管理器则执行对应子任务的具体动作序列;The user interaction process is decomposed into multiple subtasks. The high-level manager selects which subtask to execute, while the low-level manager executes the specific action sequence of the corresponding subtask.

分层的方式,可以更好地捕捉交互过程中的层次结构,提高样本效率,高层管理器关注更高层次的子任务选择,而低层管理器则专注于具体的动作执行,两者相互协作。The hierarchical approach can better capture the hierarchical structure in the interaction process and improve sample efficiency. The high-level manager focuses on the higher-level subtask selection, while the low-level manager focuses on the specific action execution, and the two collaborate with each other.

具体来说,时间预测模型的输入是融合交互特征序列,先通过序列建模网络获得当前状态的表示,然后基于强化学习网络输出下一时间步的预测动作(即预测的用户交互),执行该动作会产生新的状态表示,以此类推,直至预测出整个未来时间段的交互序列。Specifically, the input of the time prediction model is a fused interaction feature sequence. The current state representation is first obtained through the sequence modeling network, and then the predicted action for the next time step (i.e., the predicted user interaction) is output based on the reinforcement learning network. Executing this action will produce a new state representation, and so on, until the interaction sequence for the entire future time period is predicted.

在训练过程中,通过最大化与真实交互序列的拟合度,时间预测模型不断调整参数,提高预测的准确性。During the training process, the temporal prediction model continuously adjusts its parameters to improve the accuracy of the prediction by maximizing the fit with the real interaction sequence.

进一步的,概率图模型的构建方式包括:Furthermore, the construction methods of the probabilistic graphical model include:

定义概率图模型的随机变量,随机变量为相关环境数据中的数据;例如物体位置、光照条件、用户位置和视角等,每个随机变量取有限个离散状态,或者连续状态;根据虚拟场景中各个物体之间的相互影响关系,构建无向图结构;无向图结构中的节点表示随机变量,无向图结构中的边表示随机变量之间的相互依赖关系,通常近邻的节点之间存在边连接,远距离节点之间可能没有直接连接;Define the random variables of the probabilistic graph model. The random variables are the data in the relevant environmental data, such as object position, lighting conditions, user position and viewing angle. Each random variable takes a finite number of discrete states or continuous states. Construct an undirected graph structure based on the mutual influence relationship between objects in the virtual scene. The nodes in the undirected graph structure represent random variables, and the edges in the undirected graph structure represent the mutual dependence relationship between random variables. Usually, there are edge connections between neighboring nodes, and there may be no direct connection between distant nodes.

为每个节点定义一个节点潜在函数,用于描述该节点取不同状态的概率分布,节点潜在函数是参数化的函数,例如高斯函数或逻辑斯蒂函数;为每条边定义一个边潜在函数,用于描述相邻节点之间的相互作用;边潜在函数依赖于相邻节点的状态,用编码节点之间的兼容性或不兼容性拟合;A node potential function is defined for each node to describe the probability distribution of the node taking different states. The node potential function is a parameterized function, such as a Gaussian function or a logistic function. An edge potential function is defined for each edge to describe the interaction between adjacent nodes. The edge potential function depends on the state of the adjacent nodes and is fitted by the compatibility or incompatibility between the encoding nodes.

收集M1组的历史数据,历史数据包括虚拟场景状态的时间序列数据和用户交互行为的时间序列数据,Collect historical data of the M1 group, including time series data of virtual scene status and time series data of user interaction behavior.

初始化节点潜在函数和边潜在函数的参数,利用虚拟场景状态的时间序列数据对概率图模型进行训练,得到节点潜在函数和边潜在函数的参数;训练的方法为最大似然估计方法;即完成了概率图模型的构建。Initialize the parameters of the node potential function and the edge potential function, use the time series data of the virtual scene state to train the probabilistic graph model, and obtain the parameters of the node potential function and the edge potential function; the training method is the maximum likelihood estimation method; that is, the construction of the probabilistic graph model is completed.

未来n个虚拟场景状态的获取方式包括:The methods for obtaining the future n virtual scene states include:

将用户交互序列作为概率图模型的控制输入,用于驱动场景的变化,并定义概率图模型的转移概率,基于概率图模型的转移概率,对未来n个时间步长进行推理,得到每个时间步长下虚拟场景各个物体的概率分布,在进行推理过程中,将用户交互序列按时间步长依次输入,模拟用户在虚拟场景中的交互行为;The user interaction sequence is used as the control input of the probabilistic graphical model to drive the change of the scene, and the transition probability of the probabilistic graphical model is defined. Based on the transition probability of the probabilistic graphical model, the future n time steps are inferred to obtain the probability distribution of each object in the virtual scene at each time step. During the inference process, the user interaction sequence is input in sequence according to the time step to simulate the user's interactive behavior in the virtual scene.

对于每个时间步长,根据概率分布采样或选取场景物体的状态,构建出该时间步长下的虚拟场景状态,继而得到未来n个虚拟场景状态;场景状态包括物体位置、光照条件、用户位置和视角等多个方面的信息;For each time step, the state of the scene objects is sampled or selected according to the probability distribution to construct the virtual scene state at that time step, and then the future n virtual scene states are obtained; the scene state includes information on object position, lighting conditions, user position, and viewing angle, etc.

需要说明的是,转移概率描述了在给定当前状态和用户交互行为的条件下,场景转移到下一状态的概率分布,具体来说,当前时间步为e,用户的交互行为表示为u(e),将u(e)作为概率图模型的输入,它将影响各个节点的转移概率,在时间步e,概率图模型的联合概率分布表示为节点潜在函数和边潜在函数的乘积,边潜在函数与用户交互u(e)相关,接着,定义从时间步e转移到时间步e+1的转移概率,等于每个节点根据其邻居节点状态和用户交互u(t)转移到下一状态的条件概率的乘积,单个节点的转移概率通过学习获得,包含了用户交互对该节点转移的影响。It should be noted that the transition probability describes the probability distribution of the scene transferring to the next state given the current state and user interaction behavior. Specifically, the current time step is e, and the user's interaction behavior is represented as u(e). u(e) is used as the input of the probabilistic graph model, which will affect the transition probability of each node. At time step e, the joint probability distribution of the probabilistic graph model is expressed as the product of the node potential function and the edge potential function. The edge potential function is related to the user interaction u(e). Next, the transition probability from time step e to time step e+1 is defined, which is equal to the product of the conditional probability of each node transferring to the next state based on the state of its neighbor nodes and the user interaction u(t). The transition probability of a single node is obtained through learning, which includes the impact of user interaction on the node's transition.

定义了概率图模型的转移概率后,在推理过程中,利用该转移概率模型,结合用户的交互序列作为输入,对未来n个时间步长进行滚动推理,在每个时间步长,得到虚拟场景中各个物体状态的概率分布,再通过采样等方式从概率分布中选取物体的具体状态,就可以构建出该时间步长下的完整虚拟场景状态。After defining the transition probability of the probabilistic graphical model, in the reasoning process, the transition probability model is used, combined with the user's interaction sequence as input, to perform rolling reasoning for the next n time steps. At each time step, the probability distribution of the state of each object in the virtual scene is obtained, and then the specific state of the object is selected from the probability distribution through sampling and other methods, so that the complete virtual scene state at that time step can be constructed.

虚拟场景画面的渲染方式包括:The rendering methods of virtual scene images include:

从未来n个虚拟场景状态中解析出每个时刻场景的相关环境数据,根据解析出的相关环境数据,加载所需的三维模型资源,利用加载的三维模型资源构建三维虚拟场景;具体的渲染引擎、编解码器和传输协议而有所调整,同时,考虑实时性、低延迟、带宽利用率等因素,以确保虚拟场景的流畅呈现,高效、逼真地渲染为对应的虚拟场景画面,为用户提供比较好的交互体验。Parse the relevant environmental data of each scene at each moment from the future n virtual scene states, load the required three-dimensional model resources based on the parsed relevant environmental data, and use the loaded three-dimensional model resources to build a three-dimensional virtual scene; adjust the specific rendering engine, codec and transmission protocol, and at the same time, consider factors such as real-time, low latency, and bandwidth utilization to ensure the smooth presentation of the virtual scene, and efficiently and realistically render it into the corresponding virtual scene picture, providing users with a better interactive experience.

本实施例,能够融合多种用户交互数据,如按键、手势、眼球运动等,特别的对于虚拟交互来说手势数据的准确性较为重要,全面捕捉用户的交互意图,从而更准确地预测用户的行为,提升了交互的智能性,其次,采用基于深度强化学习的时间预测模型,能够提前预测用户未来的交互行为序列,并驱动概率图模型生成未来虚拟场景的状态变化,大大增强了交互的流畅性和自然性,此外,还利用概率图模型建模虚拟场景的上下文环境,如物体位置、光照条件等,更好地预测场景的变化,从而进一步提高了交互的准确性,总的来说,通过多模态融合、时间预测建模和概率图建模,大幅提升了用户的交互体验。This embodiment can integrate multiple user interaction data, such as buttons, gestures, eye movements, etc., especially for virtual interaction, the accuracy of gesture data is more important, which can fully capture the user's interaction intention, thereby more accurately predicting the user's behavior and improving the intelligence of the interaction. Secondly, the time prediction model based on deep reinforcement learning can predict the user's future interaction behavior sequence in advance, and drive the probabilistic graph model to generate the state changes of the future virtual scene, which greatly enhances the fluency and naturalness of the interaction. In addition, the probabilistic graph model is also used to model the context of the virtual scene, such as object position, lighting conditions, etc., to better predict the changes in the scene, thereby further improving the accuracy of the interaction. In general, through multimodal fusion, time prediction modeling and probabilistic graph modeling, the user's interaction experience is greatly improved.

实施例2Example 2

请参阅图2所示,本实施例未详细叙述部分见实施例1描述内容,提供一种虚拟场景交互系统,包括:数据采集处理模块,用于获取用户当前交互指令数据和相关环境数据,将用户当前交互指令数据进行预处理,得到融合交互特征序列;Please refer to FIG. 2 . For the parts not described in detail in this embodiment, please refer to the description of Embodiment 1. A virtual scene interaction system is provided, including: a data acquisition and processing module, which is used to obtain the user's current interaction instruction data and related environment data, and pre-process the user's current interaction instruction data to obtain a fused interaction feature sequence;

预测模块,用于将融合交互特征序列输入至预先构建完成的基于深度强化学习的时间预测模型,得到一个未来时间段内的用户交互序列;The prediction module is used to input the fused interaction feature sequence into a pre-built time prediction model based on deep reinforcement learning to obtain a user interaction sequence in a future time period;

虚拟环境调控模块,用于根据相关环境数据和用户交互序列,利用预先构建完成的概率图模型,得到未来n个虚拟场景状态;基于未来n个虚拟场景状态渲染出对应的虚拟场景画面,将虚拟场景画面传输至用户端设备,各个模块之间通过有线和/或无线的方式进行连接,实现模块间的数据传输。The virtual environment control module is used to obtain n future virtual scene states based on relevant environmental data and user interaction sequences using a pre-built probabilistic graph model; render the corresponding virtual scene images based on the n future virtual scene states, and transmit the virtual scene images to the user-end device. The modules are connected by wired and/or wireless means to achieve data transmission between modules.

实施例3Example 3

本实施例公开提供了一种电子设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现上述所提供的一种虚拟场景交互方法的运行方式。This embodiment discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, an operation mode of a virtual scene interaction method provided above is implemented.

由于本实施例所介绍的电子设备为实施本申请实施例中一种虚拟场景交互方法所采用的电子设备,故而基于本申请实施例中所介绍的一种虚拟场景交互方法,本领域所属技术人员能够了解本实施例的电子设备的具体实施方式以及其各种变化形式,所以在此对于该电子设备如何实现本申请实施例中的方法不再详细介绍。只要本领域所属技术人员实施本申请实施例中一种虚拟场景交互方法所采用的电子设备,都属于本申请所欲保护的范围。Since the electronic device introduced in this embodiment is an electronic device used to implement a virtual scene interaction method in the embodiment of the present application, based on the virtual scene interaction method introduced in the embodiment of the present application, a person skilled in the art can understand the specific implementation of the electronic device of the present embodiment and its various variations, so how the electronic device implements the method in the embodiment of the present application is not described in detail here. As long as a person skilled in the art implements an electronic device used in a virtual scene interaction method in the embodiment of the present application, it belongs to the scope of protection of this application.

上述公式均是去量纲取其数值计算,公式是由采集大量数据进行软件模拟得到最近真实情况的一个公式,公式中的预设参数以及阈值选取由本领域的技术人员根据实际情况进行设置。The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and thresholds in the formula are set by technicians in this field according to actual conditions.

以上所述仅是本发明的优选实施方式,本发明的保护范围并不仅局限于上述实施例,凡属于本发明思路下的技术方案均属于本发明的保护范围。应当指出,对于本技术领域的普通技术用户来说,在不脱离本发明原理前提下的若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technical users in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims (6)

1.一种虚拟场景交互方法,其特征在于,包括:S1、获取用户当前交互指令数据和相关环境数据,将用户当前交互指令数据进行预处理,得到融合交互特征序列;1. A virtual scene interaction method, characterized by comprising: S1, obtaining user current interaction instruction data and related environment data, preprocessing the user current interaction instruction data, and obtaining a fused interaction feature sequence; S2、将融合交互特征序列输入至预先构建完成的基于深度强化学习的时间预测模型,得到一个未来时间段内的用户交互序列;S2. Input the fused interaction feature sequence into the pre-built time prediction model based on deep reinforcement learning to obtain a user interaction sequence in a future time period; S3、根据相关环境数据和用户交互序列,利用预先构建完成的概率图模型,得到未来n个虚拟场景状态;基于未来n个虚拟场景状态渲染出对应的虚拟场景画面,将虚拟场景画面传输至用户端设备;S3. According to the relevant environmental data and the user interaction sequence, the pre-built probabilistic graph model is used to obtain n future virtual scene states; based on the n future virtual scene states, the corresponding virtual scene images are rendered, and the virtual scene images are transmitted to the user terminal device; 所述用户当前交互指令数据包括用户输入设备操作数据和生物特征数据;The user's current interaction instruction data includes user input device operation data and biometric data; 用户输入设备操作数据包括按键数据、手势数据和设备位移数据;生物特征数据包括眼球运动数据和肢体运动数据;User input device operation data includes key data, gesture data, and device displacement data; biometric data includes eye movement data and limb movement data; 相关环境数据包括用户所处虚拟位置数据、视角方向数据和用户所处环境状态数据;用户所处环境状态数据包括场景物体位置数据和光照数据;所述按键数据包括按键事件的时间戳、按键编码和扫描码;The relevant environment data includes the user's virtual position data, viewing direction data and the user's environment state data; the user's environment state data includes scene object position data and lighting data; the key data includes the timestamp, key code and scan code of the key event; 所述手势数据的获取方式包括:The method for acquiring the gesture data includes: 采用深度相机以固定的帧率持续采集用户手部区域的点云数据,构成点云数据序列;A depth camera is used to continuously collect point cloud data of the user's hand area at a fixed frame rate to form a point cloud data sequence; 从点云数据序列中提取手部精确点云数据,将手部区域点云数据进行降采样,得到完整手部点云数据;Extracting accurate hand point cloud data from the point cloud data sequence, downsampling the hand area point cloud data to obtain complete hand point cloud data; 将完整手部点云数据进行特征提取,得到手掌法向量、指尖位置向量、指根位置向量和指间角度向量;将手掌法向量、指尖位置向量、指根位置向量和指间角度向量拼接得到手势特征向量;The complete hand point cloud data is subjected to feature extraction to obtain the palm normal vector, fingertip position vector, finger base position vector and inter-finger angle vector; the palm normal vector, fingertip position vector, finger base position vector and inter-finger angle vector are concatenated to obtain the gesture feature vector; 将获得的手势特征向量按照时间的先后排列成一个手势特征向量序列,将手势特征向量序列输入至预先训练完成的手势识别模型中,输出对应的手势类型的概率分布,取概率分布中概率最大的手势类型的编码作为手势数据;Arrange the acquired gesture feature vectors into a gesture feature vector sequence in chronological order, input the gesture feature vector sequence into a pre-trained gesture recognition model, output the probability distribution of the corresponding gesture type, and take the code of the gesture type with the largest probability in the probability distribution as the gesture data; 所述将用户当前交互指令数据进行预处理的方式包括:The method of preprocessing the user's current interaction instruction data includes: 将用户当前交互指令数据中不同模态的数据进行归一化处理,得到归一化指令数据;Normalizing the data of different modes in the user's current interaction instruction data to obtain normalized instruction data; 将归一化指令数据进行时间序列上的对齐,得到对应的多模态序列;将多模态序列在时间维度上拼接,形成一个具有g个特征通道的特征时间序列数据;Align the normalized instruction data in time series to obtain the corresponding multimodal sequence; splice the multimodal sequence in time dimension to form a feature time series data with g feature channels; 将特征时间序列数据构建为一个三维张量,其中两个维度表示时间和特征通道,第三个维度用于表示对应的数据;The feature time series data is constructed as a three-dimensional tensor, where two dimensions represent time and feature channels, and the third dimension is used to represent the corresponding data; 所述基于深度强化学习的时间预测模型的构建方式包括:The method for constructing the time prediction model based on deep reinforcement learning includes: 时间预测模型包括序列建模网络和强化学习网络;将门控循环单元网络作为序列建模网络的基础框架,门控循环单元网络包括网络输入层、GRU隐藏层和状态表示输出层;The time prediction model includes a sequence modeling network and a reinforcement learning network. The gated recurrent unit network is used as the basic framework of the sequence modeling network. The gated recurrent unit network includes a network input layer, a GRU hidden layer, and a state representation output layer. 收集N1组的交互序列数据,每个交互序列数据包含时间步特征表示和对应的标签;Collect interaction sequence data of group N1, each interaction sequence data contains time step feature representation and corresponding label; 将交互序列数据按照批次逐步输入至门控循环单元网络得到对应批次的最终状态向量,将对应批次的最终状态向量输入到预设的分类器中得到预测的标签概率的分布;计算标签概率和标签之间的交叉熵损失,对门控循环单元网络和分类器的可训练参数使用优化器进行梯度更新,并最小化交叉熵损失,得到序列建模网络;The interactive sequence data is gradually input into the gated recurrent unit network in batches to obtain the final state vector of the corresponding batch, and the final state vector of the corresponding batch is input into the preset classifier to obtain the distribution of the predicted label probability; the cross entropy loss between the label probability and the label is calculated, and the trainable parameters of the gated recurrent unit network and the classifier are gradient updated using an optimizer, and the cross entropy loss is minimized to obtain a sequence modeling network; 定义强化学习网络为一个半马尔可夫决策过程,为半马尔可夫决策过程定义一个元组(S1,N2,P1,R1);其中,S1是低层管理器的决策的状态空间,N2是高层管理器可选择的子任务空间,P1是低层管理器的决策的状态转移函数,R1是低层管理器的决策的奖赏函数;Define the reinforcement learning network as a semi-Markov decision process, and define a tuple (S1, N2, P1, R1) for the semi-Markov decision process; where S1 is the state space of the decision of the low-level manager, N2 is the subtask space that the high-level manager can choose, P1 is the state transition function of the decision of the low-level manager, and R1 is the reward function of the decision of the low-level manager; 将半马尔可夫决策过程划分为高层管理器的策略和低层管理器的策略;定义半马尔可夫决策过程的目标是学习一个最优的高层管理器的策略和Q个最优的低层管理器的策略,将交互序列数据通过门控循环单元网络获取的对应批次的最终状态向量,作为半马尔可夫决策过程的状态,训练半马尔可夫决策过程,并使用策略梯度算法分别优化高层管理器的策略和低层管理器的策略;使得在半马尔可夫决策过程中计算的期望累积奖赏最大化;得到构建完成的强化学习网络;The semi-Markov decision process is divided into the strategy of the high-level manager and the strategy of the low-level manager; the goal of the semi-Markov decision process is defined as learning an optimal strategy of the high-level manager and Q optimal strategies of the low-level managers, the final state vector of the corresponding batch obtained by the gated recurrent unit network of the interaction sequence data is used as the state of the semi-Markov decision process, the semi-Markov decision process is trained, and the strategy of the high-level manager and the strategy of the low-level manager are optimized respectively using the policy gradient algorithm; the expected cumulative reward calculated in the semi-Markov decision process is maximized; and the reinforcement learning network is constructed; 所述概率图模型的构建方式包括:The construction method of the probability graph model includes: 定义概率图模型的随机变量,随机变量为相关环境数据中的数据;根据虚拟场景中各个物体之间的相互影响关系,构建无向图结构;无向图结构中的节点表示随机变量,无向图结构中的边表示随机变量之间的相互依赖关系;为每个节点定义一个节点潜在函数,为每条边定义一个边潜在函数;Define random variables of the probabilistic graph model, where the random variables are data in the relevant environmental data; construct an undirected graph structure based on the mutual influence relationship between various objects in the virtual scene; the nodes in the undirected graph structure represent random variables, and the edges in the undirected graph structure represent the mutual dependence relationship between random variables; define a node potential function for each node, and define an edge potential function for each edge; 收集M1组的历史数据,历史数据为虚拟场景状态的时间序列数据;初始化节点潜在函数和边潜在函数的参数,利用虚拟场景状态的时间序列数据对概率图模型进行训练,得到节点潜在函数和边潜在函数的参数;训练的方法为最大似然估计方法;即完成了概率图模型的构建;Collect historical data of group M1, which is the time series data of virtual scene status; initialize the parameters of node potential function and edge potential function, use the time series data of virtual scene status to train the probability graph model, and obtain the parameters of node potential function and edge potential function; the training method is the maximum likelihood estimation method; thus, the construction of the probability graph model is completed; 所述未来n个虚拟场景状态的获取方式包括:The method of obtaining the future n virtual scene states includes: 定义概率图模型的转移概率,基于概率图模型的转移概率,对未来n个时间步长进行推理,得到每个时间步长下虚拟场景各个物体的概率分布,在进行推理过程中,将用户交互序列按时间步长依次输入概率图模型;Define the transition probability of the probabilistic graphical model, and based on the transition probability of the probabilistic graphical model, infer the next n time steps to obtain the probability distribution of each object in the virtual scene at each time step. During the inference process, input the user interaction sequence into the probabilistic graphical model in sequence according to the time step; 对于每个时间步长,根据概率分布采样或选取场景物体的状态,构建出该时间步长下的虚拟场景状态,继而得到未来n个虚拟场景状态。For each time step, the state of the scene objects is sampled or selected according to the probability distribution to construct the virtual scene state at that time step, and then the future n virtual scene states are obtained. 2.根据权利要求1所述的虚拟场景交互方法,其特征在于,所述进行降采样的方式包括:2. The virtual scene interaction method according to claim 1, characterized in that the downsampling method comprises: 将点云数据序列有序地插入到预先构建完成的八叉树中,然后以固定的空间分辨率对八叉树进行遍历,得到完整手部点云数据;Insert the point cloud data sequence into the pre-built octree in an orderly manner, and then traverse the octree at a fixed spatial resolution to obtain the complete hand point cloud data; 所述八叉树的构建方式包括:The octree is constructed in the following manner: 将点云数据序列所在的三维空间划分为规则的立方体单元,根据点云数据序列中点的坐标,将每个点插入到对应的立方体单元中,对于包含m个点的立方体单元,将其继续递归划分为8个子单元,直到每个立方体单元内最多只有一个点,即初步完成八叉树的构建;The three-dimensional space where the point cloud data sequence is located is divided into regular cubic units. According to the coordinates of the points in the point cloud data sequence, each point is inserted into the corresponding cubic unit. For a cubic unit containing m points, it is further recursively divided into 8 sub-units until there is at most one point in each cubic unit, that is, the construction of the octree is preliminarily completed; 所述对八叉树进行遍历的方式包括:The method of traversing the octree includes: 设置一个距离阈值d,从八叉树的根节点开始,按照深度优先或广度优先的遍历八叉树的每个节点,对于每个非空的节点,计算节点中所有点到节点中心的距离,选取距离节点中心最近的点作为该节点的代表点;Set a distance threshold d, start from the root node of the octree, traverse each node of the octree in depth-first or breadth-first order, and for each non-empty node, calculate the distance from all points in the node to the center of the node, and select the point closest to the center of the node as the representative point of the node; 初始化一个空的列表L,遍历八叉树的每个非空的节点X,计算X的中心点c和代表点p之间的距离d(c,p),若d(c,p)大于或等于d,则将p加入列表L,最终列表L中的点即为完整手部点云数据;Initialize an empty list L, traverse each non-empty node X of the octree, calculate the distance d(c,p) between the center point c of X and the representative point p, if d(c,p) is greater than or equal to d, then add p to the list L, and finally the points in the list L are the complete hand point cloud data; 其中,距离d(c,p)的计算公式为:The calculation formula of the distance d(c,p) is: 其中,(cx,cy,cz)为中心点c的三维坐标,(px,py,pz)为代表点p的三维坐标。 Among them, (c x , cy ,c z ) are the three-dimensional coordinates of the center point c, and (p x , py ,p z ) are the three-dimensional coordinates of the representative point p. 3.根据权利要求2所述的虚拟场景交互方法,其特征在于,所述进行特征提取的方式包括:3. The virtual scene interaction method according to claim 2, characterized in that the feature extraction method comprises: 将完整手部点云数据进行主成分分析,得到主方向向量手掌法向量为与手部所在的三维坐标系的z轴负方向的矢量积,即其中,为z轴的单位向量;Perform principal component analysis on the complete hand point cloud data to obtain the main direction vector Palm normal vector for The vector product of the negative z-axis direction of the three-dimensional coordinate system where the hand is located, that is, in, is the unit vector of the z-axis; 将完整手部点云数据构造成集合P,基于集合P构造完整的凸壳CH(P);The complete hand point cloud data is constructed into a set P, and a complete convex hull CH(P) is constructed based on the set P; 对完整的CH(P)进行层次聚类,得到k+1个层次,记作L0,L1,...,Lk-1,Lk;其中,Lk-1即为指尖点集;Perform hierarchical clustering on the complete CH(P) to obtain k+1 levels, denoted as L0, L1, ..., Lk-1, Lk; where Lk-1 is the fingertip point set; 对Lk-1中的每个点vj,遍历CH(P)上的所有顶点,计算vj到所有顶点的欧几里得距离并取最小值dj,计算完所有vj的dj后,取dj的最小值对应的点,即为指尖位置,将指尖位置进行向量化,即得到指尖位置向量其中,t为手指的索引;For each point vj in Lk-1, traverse all vertices on CH(P), calculate the Euclidean distance from vj to all vertices and take the minimum value dj. After calculating the dj of all vj, take the point corresponding to the minimum value of dj, which is the fingertip position. Vectorize the fingertip position to get the fingertip position vector Where t is the index of the finger; 计算每个指尖位置向量到手掌平面的距离dt,沿手掌平面的法线方向从往回偏移α得到对应指根位置向量其中,α为经验系数;Calculate the position vector of each fingertip Distance dt to the palm plane, along the normal to the palm plane Direction from Shift back α to get the corresponding root position vector Among them, α is the empirical coefficient; 对于任意两相邻的指尖位置向量和计算的矢量和的矢量其中,为t+1手指对应的指根位置向量;For any two adjacent fingertip position vectors and calculate Vector and Vector in, is the finger root position vector corresponding to the t+1 finger; 则基于矢量和计算得到指间角度将指间角度向量化,即得到指间角度向量。Based on vector and Calculate the finger angle The inter-finger angle is vectorized to obtain the inter-finger angle vector. 4.根据权利要求3所述的虚拟场景交互方法,其特征在于,所述凸壳CH(P)的构造方式包括:4. The virtual scene interaction method according to claim 3, characterized in that the construction method of the convex hull CH(P) includes: 初始时,凸壳CH(P)为任意4个不共面的点构成的四面体,对于集合P中的点b,若b在CH(P)内,则忽略b,若b在CH(P)上,则将b添加到CH(P)的顶点集合,若b在CH(P)外,则用b对CH(P)进行遍历划分,生成新的CH(P),最终得到完整的CH(P);Initially, the convex hull CH(P) is a tetrahedron formed by any four non-coplanar points. For a point b in the set P, if b is in CH(P), then b is ignored. If b is on CH(P), then b is added to the vertex set of CH(P). If b is outside CH(P), then b is used to traverse and divide CH(P) to generate a new CH(P), and finally a complete CH(P) is obtained. 所述进行层次聚类的方式包括:The method of performing hierarchical clustering includes: 初始化L0等于CH(P),对于每一个层次Lr,r属于区间[0,k],且k为大于1的正整数;计算Lr中所有点对(vp,vq)的欧几里得距离d(vp,vq),提取最大的欧几里得距离对应的点对(pi,pj),将(pi,pj)合并为一个新的簇,移除pi和pj,将剩余的点和新的簇组成新的点集Lr+1;重复直至Lr+1为空集或只包含一个簇,即完成了对完整的CH(P)的层次聚类。Initialize L0 equal to CH(P). For each level Lr, r belongs to the interval [0, k], and k is a positive integer greater than 1; calculate the Euclidean distance d(vp, vq) of all point pairs (vp, vq) in Lr, extract the point pair (pi, pj) corresponding to the largest Euclidean distance, merge (pi, pj) into a new cluster, remove pi and pj, and form a new point set Lr+1 with the remaining points and the new cluster; repeat until Lr+1 is an empty set or contains only one cluster, and the hierarchical clustering of the complete CH(P) is completed. 5.根据权利要求4所述的虚拟场景交互方法,其特征在于,所述手势识别模型的训练方式包括:5. The virtual scene interaction method according to claim 4, characterized in that the training method of the gesture recognition model includes: 收集M组手势动作的手势特征向量序列及其对应的手势类型的编码,构成训练数据集;定义时间卷积网络作为手势识别模型的骨干网络,时间卷积网络由h个残差时间卷积块组成,每个残差时间卷积块包括时间卷积层和dropout层,并在时间卷积层和dropout层中加入残差连接;Collect gesture feature vector sequences of M groups of gesture actions and the encoding of their corresponding gesture types to form a training data set; define a temporal convolutional network as the backbone network of the gesture recognition model, the temporal convolutional network consists of h residual temporal convolutional blocks, each residual temporal convolutional block includes a temporal convolutional layer and a dropout layer, and residual connections are added to the temporal convolutional layer and the dropout layer; 时间卷积层的计算公式为:The calculation formula of the temporal convolution layer is: 其中,ys为时间卷积层在时间步s时的输出特征,k为卷积核的大小,i为卷积核在时间维度上的偏移量,xs-i为第s-i个时间步的输入特征,Θ表示卷积操作,wi为卷积核系数,B为偏置项,f()为ReLU函数,f(xs-i)是将输入特征xs-i通过ReLU函数进行变换后的结果; Among them, y s is the output feature of the temporal convolution layer at time step s, k is the size of the convolution kernel, i is the offset of the convolution kernel in the time dimension, x si is the input feature of the si-th time step, Θ represents the convolution operation, wi is the convolution kernel coefficient, B is the bias term, f() is the ReLU function, and f(x si ) is the result of transforming the input feature x si through the ReLU function; 最后一个残差时间卷积块的输出是上下文特征序列,将骨干网络添加一个分类头,将上下文特征序列输入分类头,对上下文特征序列中每个时间步的特征使用全连接层进行分类,得到手势类型的概率分布;The output of the last residual temporal convolution block is a context feature sequence. A classification head is added to the backbone network, and the context feature sequence is input into the classification head. The features of each time step in the context feature sequence are classified using a fully connected layer to obtain the probability distribution of the gesture type. 进行分类的公式为:P(yscs)=Softmax(Wql·cs+Bql);其中,Wql为全连接层的权重,Bql为全连接层的偏置,cs为上下文特征序列在时间步s处的特征;The classification formula is: P( yscs ) = Softmax( Wql · cs + Bql ); where Wql is the weight of the fully connected layer, Bql is the bias of the fully connected layer, and cs is the feature of the context feature sequence at time step s; 定义手势识别模型的损失函数其中,S为上下文特征序列的总长度,为第s个时间步的真实的手势类型的编码;Define the loss function of the gesture recognition model Among them, S is the total length of the context feature sequence, is the encoding of the actual gesture type at the s-th time step; 利用训练数据集训练手势识别模型,过程中最小化损失函数,并不断优化手势识别模型的参数,得到训练完成的手势识别模型。The gesture recognition model is trained using the training data set, the loss function is minimized in the process, and the parameters of the gesture recognition model are continuously optimized to obtain a trained gesture recognition model. 6.一种虚拟场景交互系统,用于实现权利要求1至5中任一项所述的虚拟场景交互方法,其特征在于,包括:数据采集处理模块,用于获取用户当前交互指令数据和相关环境数据,将用户当前交互指令数据进行预处理,得到融合交互特征序列;6. A virtual scene interaction system, used to implement the virtual scene interaction method according to any one of claims 1 to 5, characterized in that it comprises: a data acquisition and processing module, used to obtain the user's current interaction instruction data and related environmental data, and pre-process the user's current interaction instruction data to obtain a fused interaction feature sequence; 预测模块,用于将融合交互特征序列输入至预先构建完成的基于深度强化学习的时间预测模型,得到一个未来时间段内的用户交互序列;The prediction module is used to input the fused interaction feature sequence into a pre-built time prediction model based on deep reinforcement learning to obtain a user interaction sequence in a future time period; 虚拟环境调控模块,用于根据相关环境数据和用户交互序列,利用预先构建完成的概率图模型,得到未来n个虚拟场景状态;基于未来n个虚拟场景状态渲染出对应的虚拟场景画面,将虚拟场景画面传输至用户端设备,各个模块之间通过有线和/或无线的方式进行连接。The virtual environment control module is used to obtain n future virtual scene states based on relevant environmental data and user interaction sequences using a pre-built probabilistic graph model; render corresponding virtual scene images based on the n future virtual scene states, and transmit the virtual scene images to the user-end device. The modules are connected via wired and/or wireless means.
CN202410799538.7A 2024-06-20 2024-06-20 Virtual scene interaction method and system Active CN118377384B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410799538.7A CN118377384B (en) 2024-06-20 2024-06-20 Virtual scene interaction method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410799538.7A CN118377384B (en) 2024-06-20 2024-06-20 Virtual scene interaction method and system

Publications (2)

Publication Number Publication Date
CN118377384A CN118377384A (en) 2024-07-23
CN118377384B true CN118377384B (en) 2024-09-10

Family

ID=91908888

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410799538.7A Active CN118377384B (en) 2024-06-20 2024-06-20 Virtual scene interaction method and system

Country Status (1)

Country Link
CN (1) CN118377384B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119722854B (en) * 2025-03-03 2025-04-29 浙江大学 Space curve drawing and geometry generating and interacting method based on mixed reality
CN120747317B (en) * 2025-09-08 2025-11-28 苏州大学 A method and apparatus for generating interactive animations between characters and dynamic scenes.
CN121236339B (en) * 2025-12-02 2026-02-27 快上云(上海)网络科技有限公司 A method and system for generating virtual worlds based on AI
CN121578895A (en) * 2026-01-27 2026-02-27 汇智天下(杭州)科技有限公司 Contactless control method and device for aerial imaging

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112509151A (en) * 2020-12-11 2021-03-16 华中师范大学 Method for generating sense of reality of virtual object in teaching scene
CN114035678A (en) * 2021-10-26 2022-02-11 山东浪潮科学研究院有限公司 Auxiliary judgment method based on deep learning and virtual reality

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11714880B1 (en) * 2016-02-17 2023-08-01 Ultrahaptics IP Two Limited Hand pose estimation for machine learning based gesture recognition
US11537264B2 (en) * 2018-02-09 2022-12-27 Sony Interactive Entertainment LLC Methods and systems for providing shortcuts for fast load when moving between scenes in virtual reality
US11308698B2 (en) * 2019-12-05 2022-04-19 Facebook Technologies, Llc. Using deep learning to determine gaze
CN112130660B (en) * 2020-08-14 2024-03-15 青岛小鸟看看科技有限公司 An interactive method and system based on virtual reality all-in-one machine
US11868516B2 (en) * 2022-03-04 2024-01-09 Humane, Inc. Hand-specific laser projected virtual interfaces and operations
CN117241063B (en) * 2023-11-13 2024-01-26 中影年年(北京)文化传媒有限公司 Live broadcast interaction method and system based on virtual reality technology

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112509151A (en) * 2020-12-11 2021-03-16 华中师范大学 Method for generating sense of reality of virtual object in teaching scene
CN114035678A (en) * 2021-10-26 2022-02-11 山东浪潮科学研究院有限公司 Auxiliary judgment method based on deep learning and virtual reality

Also Published As

Publication number Publication date
CN118377384A (en) 2024-07-23

Similar Documents

Publication Publication Date Title
CN118535023B (en) A visual interaction system based on multimodality
Shi et al. Self-supervised discovering of interpretable features for reinforcement learning
US12094247B2 (en) Expression recognition method and related apparatus
CN113221663B (en) A real-time sign language intelligent recognition method, device and system
CN110569795B (en) Image identification method and device and related equipment
CN118377384A (en) A virtual scene interaction method and system
US20210390653A1 (en) Learning robotic tasks using one or more neural networks
CN117197878B (en) Character facial expression capturing method and system based on machine learning
US9111375B2 (en) Evaluation of three-dimensional scenes using two-dimensional representations
CN110555481A (en) A portrait style recognition method, device and computer-readable storage medium
CN112121419B (en) Virtual object control method, device, electronic device and storage medium
CN114581502B (en) Three-dimensional human body model joint reconstruction method based on monocular image, electronic device and storage medium
CN112199994B (en) A method and device for real-time detection of 3D hands interacting with unknown objects in RGB video
CN117191046B (en) Crowd navigation method and system based on deep reinforcement learning and graph neural network
CN113268143B (en) A Multimodal Human-Computer Interaction Method Based on Reinforcement Learning
CN114359785A (en) Lip language identification method and device based on adaptive matrix feature fusion network and electronic equipment
CN116542292B (en) Training methods, devices, equipment and storage media for image generation models
CN119514886B (en) Pedestrian trajectory prediction method and device based on heterogeneous relationship graph
CN117011856A (en) Handwriting skeleton refining method, system, equipment and medium based on deep reinforcement learning
Mohanta et al. Deep learning is a state-of-the-art approach to artificial intelligence
CN111611852A (en) A method, device and equipment for training an expression recognition model
CN119206399A (en) Training method, device, equipment and medium for synthetic data generation network
CN113628107A (en) Face image super-resolution method and system
CN121747139A (en) Task execution method, device, equipment and medium
CN113039561A (en) Aligning sequences by generating encoded representations of data items

Legal Events

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