A machine learning based indoor ray tracing visible face prediction method
Patent Information
- Application Number
- CN202611025575.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-10-23
AI Technical Summary
[0008]本发明针对现有射线追踪算法中线面判交冗余度过高的问题,提供一种基于机器学习的室内射线追踪可见面预测方法,通过神经网络学习空间坐标与可见面片之间的映射关系,实现可见面片的快速预测,进而减少无效判交,提高射线追踪计算效率
[0020]1. 本发明利用多层感知机神经网络直接学习空间位置与可见面片之间的非线性映射关系,将传统算法中需要通过几何遍历完成的可见性判断转化为神经网络的前向推理,能够在毫秒级时间内输出可见面候选集,大幅减少线面判交次数。
Smart Images

Figure CN122966819A_ABST
Abstract
Description
Technical Field
[0002] This invention belongs to the field of ray tracing technology, specifically relating to a machine learning-based method for predicting visible surfaces in indoor ray tracing, which is suitable for accelerating ray tracing in indoor wireless channel modeling. Background Technology
[0004] Ray tracing is a technique based on geometric optics, geometric diffraction theory, and uniform diffraction theory. It calculates and predicts channel characteristics in specific scenarios by tracing the propagation paths of electromagnetic waves, including direct, reflected, and diffracted paths. This technique is widely recognized in the field of channel modeling due to its high accuracy and wide applicability. With the increasing complexity of indoor environments and the advancement of 5G frequency bands, its performance advantages in future mobile communication channel modeling will become increasingly prominent.
[0005] Ray tracing is mainly divided into two categories: forward ray tracing and reverse ray tracing. The former is represented by the bounce ray method, and the latter by the mirror ray method. Among them, forward ray tracing has become the most widely used method due to its adaptability to complex scenarios and high computational efficiency. Its core principle is to emit rays uniformly at fixed angular intervals from the transmitting end, trace the ray path one by one, calculate the reflection and diffraction process, and finally summarize the effective paths to synthesize the channel response.
[0006] However, this algorithm suffers from high computational costs in complex scenes with massive geometric surfaces, with the intersection determination of rays and geometric surfaces being the most time-consuming step. A single ray intersects only one surface, but it needs to be tested with a large number of surfaces one by one, resulting in a great deal of redundant computation. Therefore, pre-screening potential intersecting surfaces and reducing redundant intersection determination are the core keys to accelerating ray tracing. Summary of the Invention
[0008] This invention addresses the problem of excessive redundancy in line-surface intersection judgment in existing ray tracing algorithms by providing a machine learning-based method for predicting visible surfaces in indoor ray tracing. By learning the mapping relationship between spatial coordinates and visible surfaces through a neural network, the method enables rapid prediction of visible surfaces, thereby reducing invalid intersection judgments and improving the computational efficiency of ray tracing.
[0009] This invention proposes a machine learning-based method for predicting visible surfaces using indoor ray tracing, comprising the following steps:
[0010] Step 1: Construct an indoor environment model represented by triangular facets and assign a unique number to each triangular facet;
[0011] Step 2: Collect the 3D coordinates of a large number of sampling points in space, and calculate the set of visible face numbers corresponding to each sampling point using the traditional ray tracing method to construct a training dataset;
[0012] Step 3: Construct a multilayer perceptron neural network, using the 3D coordinates of the sampling points as input and the binary label vectors of the corresponding visible face as output, to train and obtain a visible face prediction model;
[0013] Step 4: During ray tracing, for a given emission point, input the coordinates of that point into the trained visible face prediction model, and output the candidate set of visible face patches for that point;
[0014] Step 5: The ray is only used to perform line-to-face intersection calculations with the faces in the candidate set. Faces outside the candidate set are eliminated, and the nearest face to which the ray actually intersects is determined based on the intersection results.
[0015] Furthermore, in step 2, the specific method for calculating the set of visible face numbers of the sampling point using the traditional ray tracing method is as follows: emitting spheres are placed at the sampling point, densely emitting detection rays in all directions, and recording the face numbers of all faces that effectively intersect with the rays.
[0016] Furthermore, in step 2, each sample in the training dataset consists of a sampling point coordinate vector and a visible face binary label vector, where the dimension of the visible face binary label vector is equal to the total number of triangular faces in the scene, and each element in the vector takes a value of 1 to indicate that the face is visible, and a value of 0 to indicate that it is not visible.
[0017] Further, in step 3, the multilayer perceptron neural network includes an input layer, at least one hidden layer, and an output layer; the input layer has 3 neurons, corresponding to three-dimensional coordinates; the output layer has the same number of neurons as the total number of triangular faces in the scene, and the output layer uses the Sigmoid activation function to map each output value to the interval 0~1, representing the visibility probability of the corresponding face; the hidden layer uses the ReLU activation function.
[0018] Furthermore, the loss function of the multilayer perceptron neural network adopts the binary cross-entropy loss function, and the optimizer adopts the Adam optimizer.
[0019] The beneficial effects of this invention are:
[0020] 1. This invention utilizes a multilayer perceptron neural network to directly learn the nonlinear mapping relationship between spatial location and visible facets, transforming the visibility judgment that traditional algorithms require geometric traversal into forward inference of the neural network. It can output a candidate set of visible faces in milliseconds, significantly reducing the number of line-face intersection judgments.
[0021] 2. This invention effectively solves the problem of positive and negative sample imbalance in sparse multi-label classification of visible images by constructing a "coordinate-visible face label" dataset and training the model using binary cross-entropy loss and Adam optimizer, thus ensuring high recall and low false alarm rate in prediction.
[0022] 3. This invention integrates the visible face prediction module into the forward ray tracing process, dynamically acquiring the candidate set of visible faces at the current point before each ray is emitted or each reflection. It has strong versatility, can be adapted to various forward ray tracing algorithms, and significantly improves its computational efficiency in complex indoor environments. Attached Figure Description
[0024] Figure 1 This is an overall flowchart of the method of the present invention.
[0025] Figure 2 This is a schematic diagram illustrating the use of traditional ray tracing methods to obtain a visible point in space according to the present invention.
[0026] Figure 3 This is a schematic diagram of the multilayer perceptron neural network structure in this invention.
[0027] Figure 4 This is a triangular patch model diagram of the test environment in an embodiment of the present invention.
[0028] Figure 5 This is a schematic diagram of an actual visible surface at a point p in space, as described in an embodiment of the present invention.
[0029] Figure 6 This is a schematic diagram of a visible surface predicted by the method of the present invention for a point p in space, as shown in an embodiment of the present invention.
[0030] Figure 7 This is a graph showing the change of the loss function of the neural network training in this embodiment of the invention with the number of training rounds. Detailed Implementation
[0032] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. However, the embodiments can be implemented in many forms, and the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0033] This embodiment provides a machine learning-based method for predicting visible surfaces using indoor ray tracing, applied to an indoor environment measuring 20m × 20m × 10m. Figure 4 As shown, after discretization by triangular facets, a total of 132 triangular facets were obtained.
[0034] Step 1: Data Collection
[0035] Training data was collected using a traditional ray tracing method. 9650 points were uniformly sampled within the indoor space, with each point's coordinates labeled (x, y, z). Figure 2 As shown, a sphere was deployed at each sampling point to emit densely packed detection rays evenly around the entire area. The numbers of all triangular facets that effectively intersected with the rays were recorded. The label vectors corresponding to these numbers were set to 1, and the rest were set to 0, resulting in a binary label vector of length 132. A total of 9650 samples were collected and randomly divided into a training set (7720 sets) and a test set (1930 sets) in an 8:2 ratio.
[0036] Step 2: Constructing a neural network
[0037] Construct a multilayer perceptron neural network, the structure of which is as follows: Figure 3 As shown: the input layer has 3 neurons, corresponding to spatial coordinates (x, y, z); the first hidden layer has 512 neurons with the ReLU activation function; the second hidden layer has 512 neurons with the ReLU activation function; the third hidden layer has 256 neurons with the ReLU activation function; and the output layer has 132 neurons with the Sigmoid activation function. The loss function used is Binary Cross Entropy Loss, the optimizer is Adam, and the initial learning rate is set to 0.001.
[0038] Step 3: Model Training
[0039] The network was trained using a training set with a batch size of 64 and 120 training epochs. The loss on the test set was monitored during training, and an early stopping mechanism was used to prevent overfitting. The curve showing the change in the loss function with the number of training epochs is shown below. Figure 7 As shown, after 120 rounds of training, the model's loss value on the test set is 0.0626, and the Hamming loss is 0.0272, meaning that on average, about 3.6 patches per sample have prediction results that do not match the true labels. The F1 micro-average is 0.956, indicating high prediction accuracy.
[0040] Step 4: Model Testing
[0041] After training, select a point P(5,5,8) in the test space that is not covered by the training set, input the coordinates of this point into the trained model, and the model outputs a 132-dimensional probability vector. After binarization with a threshold of 0.5, the candidate set of predicted visible faces is obtained. Figure 5 The dark patches in the image represent the actual visible surface at that point (obtained through high-density sphere firing). Figure 6 The dark patches in the image represent the visible surfaces predicted by the model, and the two match closely, indicating that the model has high prediction accuracy.
[0042] This model is integrated into the forward ray tracing algorithm: before the ray originates from the emission point, the model outputs a candidate set of visible faces for that point. The ray only performs line-to-face intersection calculations with faces in the candidate set. Under the same computing hardware conditions, for an indoor scene containing 132 faces, without acceleration methods, a single ray needs to perform intersection calculations with 132 faces; after using the method of this invention, a single ray only needs to perform intersection calculations with an average of 40.41 faces, reducing the number of face intersection calculations by approximately 69.4%.
[0043] In summary, the present invention provides an indoor ray tracing visible face prediction method based on machine learning, which efficiently predicts visible face patches of spatial points through neural networks, significantly reduces the number of line-surface intersection determinations, and achieves intelligent acceleration of ray tracing.
[0044] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents. The above-described embodiments have further detailed the purpose, technical solutions, and advantages of the present invention. It should be understood that the above-described embodiments are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made to the present invention within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A machine learning-based method for predicting visible surfaces using indoor ray tracing, characterized in that, The process includes the following steps: Step 1: Construct an indoor environment model represented by triangular facets and assign a unique number to each triangular facet; Step 2: Collect the 3D coordinates of a large number of sampling points in the space, and calculate the set of visible facet numbers corresponding to each sampling point using the traditional ray tracing method to construct a training dataset; Step 3: Construct a multilayer perceptron neural network, using the 3D coordinates of the sampling points as input and the binary label vector of the corresponding visible facet as output, to train a visible facet prediction model; Step 4: During ray tracing, for a given emission point, input the coordinates of that point into the trained visible facet prediction model and output a candidate set of visible facets for that point.
2. The indoor ray tracing visible face prediction method based on machine learning according to claim 1, characterized in that, In step 2, the specific method for calculating the set of visible facet numbers at the sampling point using traditional ray tracing is as follows: An emission sphere is deployed at the sampling point, densely emitting detection rays in all directions, and recording the facet numbers that effectively intersect with the rays. Traditional ray tracing methods are mainly divided into forward tracing and reverse tracing; this invention uses forward tracing. The principle of forward ray tracing is: an emission sphere is deployed at the emission point, emitting rays at fixed angular intervals in all directions. Each emitted ray needs to be intersected with a triangular facet in space. Intersection determination first requires determining whether the ray intersects with the plane of the target triangular facet. If an intersection exists, it needs to be determined whether the intersection is inside the target triangle; if it is, the intersection is valid. However, due to the occlusion relationship between triangular facets in space, the same ray may have valid intersections with multiple triangular facets, but only one intersection actually occurs. Therefore, it is also necessary to calculate the distance between the emission point and each valid intersection point, selecting the valid intersection point with the shortest distance as the actual intersection point.
3. The indoor ray tracing visible face prediction method based on machine learning according to claim 1, characterized in that, In step 2, each sample in the training dataset consists of a sampling point coordinate vector and a visible face binary label vector. The dimension of the visible face binary label vector is equal to the total number of triangular faces in the scene. Each element in the vector takes a value of 1 to indicate that the face is visible, and a value of 0 to indicate that it is not visible.
4. The indoor ray tracing visible face prediction method based on machine learning according to claim 1, characterized in that, In step 3, the multilayer perceptron neural network includes an input layer, at least one hidden layer, and an output layer; the input layer has 3 neurons, corresponding to three-dimensional coordinates; the output layer has the same number of neurons as the total number of triangular faces in the scene, and the output layer uses the Sigmoid activation function to map each output value to the interval 0~1, representing the visibility probability of the corresponding face; the hidden layer uses the ReLU activation function.
5. The indoor ray tracing visible face prediction method based on machine learning according to claim 4, characterized in that, The loss function of the multilayer perceptron neural network adopts the binary cross-entropy loss function, and the optimizer adopts the Adam optimizer.
6. The indoor ray tracing visible face prediction method based on machine learning according to claim 1, characterized in that, This method is applied to accelerate ray tracing in indoor wireless channel modeling. In the path search phase of ray tracing, before each ray is emitted, this method is used to filter out the set of triangular faces visible to the same ray emission point in space. The ray only needs to perform intersection tests with the triangular faces in the set, without having to consider all triangular faces in space.
7. The indoor ray tracing visible face prediction method based on machine learning according to claim 1, characterized in that, The number of hidden layers and neurons in the multilayer perceptron neural network are dynamically adjusted according to the total number of triangular facets in the scene. The more facets there are, the more neurons are added to the hidden layers.
