Breaking the Symmetry: Resolving Symmetry Ambiguities in Equivariant Neural Networks
Editors: Sophia Sanborn, Christian Shewmake, Simone Azeglio, Arianna Di Bernardo, Nina Miolane
Abstract
Equivariant networks have been adopted in many 3-D learning areas.
Here we identify a fundamental limitation of these networks: their ambiguity to symmetries.
Equivariant networks cannot complete symmetry-dependent tasks like segmenting a left-right symmetric object into its left and right sides.
We tackle this problem by adding components that resolve symmetry ambiguities while preserving rotational equivariance.
We present OAVNN:
Orientation Aware Vector Neuron Network, an extension of the Vector Neuron Network (Deng et al., 2021).
OAVNN is a rotation equivariant network that is robust to planar symmetric inputs.
Our network consists of three key components.
We introduce an algorithm to calculate symmetry detecting features.
We create a symmetry-sensitive orientation aware linear layer.
We construct an attention mechanism that relates directional information across points.
We evaluate the network using left-right segmentation and find that the network quickly obtains accurate segmentations.
We hope this work motivates investigations on the expressivity of equivariant networks on symmetric objects.
1. Introduction
3-D representations of real-life objects are used for problems in computer vision, robotics, medicine, augmented reality, and virtual reality.
Geometric deep learning leverages the geometric properties of 3-D structures to build robust and data-efficient models for tasks in these fields.
Many networks have been proposed for 3-D geometric learning and point cloud analysis, as seen in (Guo et al., 2021).
For tasks on 3-D data, the input has no prevailing pose, and the network must perform well regardless of the input pose.
These tasks lend themselves to invariance and equivariance.
Invariant models produce the same output regardless of the input pose.
Equivariant models produce outputs that are transformed in the same way as the input.
Thus these tasks motivate rotation equivariant and invariant networks that share information across all rotated poses.
These networks have shown better performance and data efficiency for unaligned data on tasks such as segmentation and reconstruction in (Deng et al., 2021); shape retrieval and scene classification in (Esteves et al., 2019); and 3-D model recognition and atomization energy regression in (Cohen et al., 2018).
Nevertheless, as shown in Figure 1, many of these networks have issues with symmetry.
Equivariant networks are equivariant to symmetries.
Therefore these networks cannot complete tasks that depend on the input symmetry.
Due to the prevalence of symmetric inputs and symmetry dependent tasks, there is a need for an equivariant network that handles symmetries.
We introduce OAVNN: Orientation Aware Vector Neuron Network, Figure 2, an extension of the Vector Neuron Network (VNN) (Deng et al., 2021).
The OAVNN is a rotation equivariant network that is robust to planar symmetric inputs.
code for the model
2. Related Work
Many equivariant designs are summarized in (Esteves, 2020).
One category uses spherical harmonics, such as (Thomas et al., 2018) and (Weiler et al., 2018).
The networks in (Cohen et al., 2019) and (Esteves et al., 2019) are similar but instead are equivariant to the symmetry group of an icosahedron.
A simpler formulation is the Vector Neuron Network (Deng et al., 2021) which is based on interpretable 3-D vectors.
Here, we focus on simple, interpretable networks like the VNN which has symmetry issues that we intend to study and improve.
A related computer graphics problem is symmetry detection, as seen in (Gao et al., 2021) and (Shi et al., 2020).
In this project, we not only study symmetry detection but also resolve expressivity issues of equivariant networks related to symmetries.
3. A Fundamental Problem in Equivariant Networks 3.1. Definitions
We consider the group O(3) of all rotation and reflection matrices.
A function f is O(3) equivariant if for all R ∈ O(3) and x ∈ R 3 , f ( R · x ) = R · f ( x ), and O(3) invariant if f ( R · x ) =
f
( x ). An O(3) equivariant function can be made invariant by taking the norm.
3.2. Ambiguity under Self-Symmetries
Equivariant networks display problems in encoding objects with self-symmetries.
Consider object X ∈ R C × 3 with self-symmetry R 0 .
When encoded by an equivariant f , due to the self-symmetry, f ( R 0 X ) =
f ( X ) .
Additionally, since f is equivariant, f ( R 0 X ) = [-
-]R 0 f
( X ) .
Thus, f ( X ) = R 0 f
( X ). Let’s call f ( X ) ⊥ the component of f ( X ) in the direction of symmetry or the component orthogonal to R 0 ’s plane of symmetry.
Then f ( X ) ⊥ =[-
-]
R 0 f
( X ) ⊥ =
− f ( X ) ⊥ .
Thus we see that f ( X ) ⊥ must be zero.
Therefore for a planar symmetric input, an O(3) equivariant function cannot predict information in the direction of symmetry .
This means an equivariant network will have trouble solving tasks that distinguish between two symmetric parts, such as symmetric segmentation.
3.3. Vector Neuron Network: An Example
Here we focus on a specific equivariant network, the VNN (Deng et al., 2021).
The VNN’s linear layer is structured as f lin ( X ) = WX , where X ∈ R C × 3 is a list of input vectors and W ∈ R C ′
× C is a learnable weight matrix.
The VNN maintains O(3) equivariance since it treats each vector input as an independent unit, and a matrix R ∈ O(3) commutes with this linear layer as f lin ( X · R ) = WX · R = f lin ( X ) · R .
The VNN also modifies ReLU, pooling, and batch normalization layers.
All modified layers operate on vectors and preserve equivariance.
The VNN also proposes an invariant layer.
The VNN has two drawbacks.
First, since it is O(3) equivariant, it cannot learn the direction of symmetry.
Second, the VNN can only share information between local patches of points.
The VNN creates local patches through a nearest neighbor embedding by concatenating each point with its k nearest neighbors.
For symmetry-dependent tasks, the network must also globally transfer information.
Consider a left-right symmetric object.
The left-right direction of symmetry is uniquely determined by the top-bottom and frontback directions.
When learning symmetries, these directions must be globally transferred.
Since the VNN cannot globally propagate information it has difficulty learning symmetries.
4. Methods
We introduce an orientation aware framework (Figure 2) to resolve the limitations of the
VNN for planar symmetric inputs.
We modify the VNN by adding three components: symmetry-detecting features defined in Section A.1, an orientation aware linear layer defined in Section A.2, and an attention mechanism defined in Section A.3.
Finally, we apply the
VNN invariant layer for tasks such as segmentation.
5. Results
We test five models using a left-right segmentation experiment run on symmetric airplane objects from the Shapenet dataset (Chang et al., 2015).
Descriptions of the models are in
Section C and the results are shown in Figure 3.
Since the segmentation is symmetric, the model must detect the direction of symmetry.
The VNN is ambiguous to symmetries and therefore fails to segment the airplane.
Any network sensitive to the direction of symmetry can complete the task.
However, the DGCNN model (Wang et al., 2019), a conventional segmentation network which is not equivariant, takes a long time to learn.
When we add symmetry-detecting features to create the Shell-Only network, we can complete the task faster.
The OAVNN model, which combines both symmetry-detecting features and the orientation aware linear layer, can obtain an accurate segmentation faster than any other model.
Therefore, as more symmetry-detecting features are added, the model completes the task faster.
A more extensive ablation study is provided in Appendix Section C. Experimental results on other object classes (caps and chairs) are also provided in Appendix
Section C.
6. Conclusions
Overall we have shown that equivariant networks are equivariant to symmetries, so their outputs are ambiguous to symmetries.
Thus these networks have trouble completing symmetrydependent tasks.
We propose the OAVNN model, which resolves symmetry ambiguities for planar symmetric objects while preserving rotational equivariance.
In the future, we hope to address more complex symmetries and symmetry-dependent tasks.
Overall, we hope this work motivates investigations into the symmetry ambiguities of equivariant networks.
Acknowledgments
We thank the Stanford Undergraduate Research Internship in Computer Science (CURIS) program for partly funding this work.
Appendix A. Methods
Here we provide more detailed explanations of the three orientation aware components of the OAVNN.
A.1. Symmetry Detecting Hand-Crafted Features
We propose hand-crafted features that detect the direction of symmetry.
We calculate these features by using the planar symmetry detection algorithm.
The algorithm is described in
Figure 4, and the pseudocode is in Algorithm 1.
It takes in two inputs: the point cloud X ∈ R C × 3 and the number of shells n .
We let X i represents the i th point in the point cloud where i ∈ { 0 , . . .
, C − 1 } .
For each point, we split the point cloud into n distancebased shells.
We let S i,j represent each distance based shells where j ∈ { 0 , . . . , n − 1 } .
For each shell, we calculate the shell vector from the starting point X i to the centroid of the shell.
We let v i,j represent the shell vector.
We then calculate the n ( n − 1)directed crossproducts c i,j,k between nearer and further shell vectors.
c i represents the cross vector for a point i (average of all directed cross products).
For some geometric intuition, the shell vectors increase in length and rotate, and the cross vector represents the axis of rotation.
The algorithm returns the average cross vector c across all points.
Symmetric points will have shell vectors rotating in opposite directions.
Therefore many components of the cross vectors will cancel out, and for a symmetric input, the average cross vector lies along the direction of symmetry.
A proof of this claim is in Appendix Section
B. The symmetry detecting feature is the average cross vector which informs the network about the object’s symmetries.
Input: X ∈ R C × 3 , n
Output: c , the direction of symmetry for i ← 0 , C − 1 do for j ← 0 , n − 1 do
S i,j ← j Cn to ( j + 1) Cn nearest neighbors v i,j ← mean ( S i,j − X i ) end for j ∈ [ n ] do for k ∈
[ j + 1 , n ] do c i,j,k ← v i,j × v i,k end end c
i ← mean j,k ( c i,j,k ) end c ← mean i ( c i )
A.2. Orientation Aware Linear Layer
We also encourage detection of the symmetry direction by creating an orientation aware complex linear layer shown in Figure 5.
The complex linear layer uses orientation to distinguish the direction of symmetry.
It takes in a list of input vectors V ∈ R N × C ×and a list of direction vectors J ∈ R N × C × 3 .
Here N represents the number of points in the point cloud, and C represents the dimension of the channel that the linear layer acts on.
The complex linear layer outputs a list of vectors in R N × C ′ × 3 .
Thus it changes the dimensionality of the channel from C to C ′ .
The complex linear layer learns a rotation and dilation for each vector in V in the direction of its corresponding vector in J .
It does this by defining two terms.
First, it creates a list of R 3 bases R ( J ) =
( U 1 , U 2 , J ) ∈ R N × C × 3 × where the list of the last vectors in each basis is J .
Each basis is positively oriented, and therefore for each basis b in R ( J ), det b
= +1.
The complex linear layer rotates and dilates each input vector in V in its corresponding basis in R ( J ) using a combined weight matrix
[Equation]
where A , B , C ∈ R C ′ ×
C are learnable weight matrices and j ∈ { 0 , 1 , . . .
, C ′ − 1 } and k ∈ { 0 , 1 , . .
, C − 1 } .
The complex linear layer outputs a list of vectors in R N × C ′ × 3 using the following formulation
[Equation]
where j and k are defined as before and i ∈ { 0 , 1 , . .
, N − 1 } .
Thus i iterates over the point dimension, k iterates over the original number of channels, and j iterates over the new number of channels.
The complex linear layer learns the direction of symmetry because at least one of the basis vectors must have a component in the direction of symmetry.
Additionally, it is sensitive to symmetry reversal, because if J is flipped, we get a rotation in the opposite direction.
This layer is inspired by Section 3.4 in DiffusionNet (Sharp et al., 2022), where J is the oriented normals to the surface.
However, in the complex linear layer, J is learned.
A.3. Attention Mechanism
We also create an attention mechanism to encourage global information transfer.
Consider a left-right symmetric airplane.
If we identify the up-down and front-back directions, we can uniquely determine the left-right direction.
Since the airplane is approximately symmetric in the up-down direction, only the tail will inform us about this direction.
We must propagate this information to all points.
To transfer information we propose an attention mechanism.
Attention was first introduced in (Bahdanau et al., 2015), and it defines the relationship between keys, queries, and values (Vaswani et al., 2017).
The attention mechanism creates a database of key and value pairs, and when given a query, it determines which pairs to attend to.
Attention has been considered for equivariant networks on point clouds in works such as (Fuchs et al., 2020).
However, we consider a different setting where each point has directional information.
Then, at each point x we look for orthogonal information over all other points to create a local reference frame at x .
The orthogonal frame will be used by the complex linear layer which requires both a direction vector and an orthogonal direction to operate on.
Therefore, we design our attention weights to be large when taking in a pair of query and key vectors that are orthogonal.
Mathematically, for keys K ∈ R C × 3 and queries Q ∈ R C × 3 , our attention weight formula is α ( Q , K ) j,k = softmax k ∥Q j, : × K k, : ∥ 2 where j ∈ { 0 , 1 , . .
, C − 1 } and k ∈ { 0 , 1 , . . .
, C − 1 } .
A diagram of the attention mechanism is shown in Figure 6.
Appendix B. Proof of Planar Symmetry Detection Algorithm
Theorem 1 For a point cloud input that is symmetric about exactly one plane, the planar symmetry detection algorithm presented in Algorithm 1 outputs a vector orthogonal to the input object’s plane of symmetry.
Proof We will call the input point cloud X .
Without loss of generality, let X be symmetric about the yz -plane.
We will show that the planar symmetry detection algorithm outputs a vector with only an x -component.
For any point x in the point cloud, there exists a point x ′ which is symmetric to x about the yz -plane.
Let s 1 = ( x 1 , y 1 , z 1 ) , . . . , s n = ( x n , y n , z n ) be the n shell vectors of x .
Since x ′ is the reflection of x about the yz -plane, the shell vectors of x ′ will be the reflection of the shell vectors of x about the yz -plane.
Therefore the shell vectors of x ′ are s ′
= ( − x 1 , y 1 , z 1 ) , . . . , s ′ n = ( − x n , y n , z n ).
The directed cross products of the shell vectors of x are of the form ( y j z k − y k
z j , x k z j − x j z k , x j y k − x k y j ) for all j ∈ { 0 , . .
. , n − 1 } and k ∈ { 0 , . .
n − 1 } where k > j .
The directed cross products of the shell vectors of x ′ are of the form ( y j z k − y k
z j , − ( x k z j − x j z k ) , − ( x j y k − x k y j )).
For any fixed ( j, k ), the sum of the directed cross product for x and x ′ will only have an x -component.
Since the vector returned by the planar symmetry detection algorithm is the average of all directed cross products across all points, the output vector of the algorithm will also only have an x -component.
Thus the output vector will be orthogonal to the input object’s plane of symmetry.
Appendix C. Ablation Study
We further analyze OAVNN by conducting an ablation study.
In particular, we investigate the two methods for learning the direction of symmetry: the symmetry detecting features and the orientation aware complex linear layer.
First, we consider running a left-right segmentation experiment using only the symmetry detecting features.
In particular, we run the planar symmetry detection algorithm on various left-right symmetric point clouds centered at the origin.
We calculate the plane, which is centered at the origin and perpendicular to the average cross vector.
We use this plane to divide each object into a left and right half-space.
The results for various object classes are in Figure 7.
On airplane objects, we obtain about 85% accuracy.
Note that out of the four example classes shown in Figure 7, the table class does noticeably worse.
This highlights one of the weaknesses of the planar symmetry detection algorithm.
This algorithm will only work for objects with exactly one plane of symmetry.
For objects like tables with two or more planes of symmetry, the algorithm outputs the zero vector.
The algorithm also has suboptimal results for objects that are approximately symmetric about two planes (e g. airplanes) or for point clouds with sampling or density issues.
Next, we create the Shell-Only network with only the symmetry detecting features and the attention mechanism.
In particular, this network does not use the orientation aware complex linear layer.
This network is similar to the VNN, however, it takes in two additional features: the symmetry detection features and the output of the attention mechanism.
The results for this model are in red in Figure 3.
We also create the Complex-Only network with only the orientation aware complex linear layer and the attention mechanism.
This network has the same architecture as the OAVNN, except the symmetry detecting features are not added.
In other words, this network does not use the planar symmetry detection algorithm.
The results of this network are in purple in Figure 3.
For airplane objects, only the VNN cannot complete the segmentation task.
Therefore any network which can detect the direction of symmetry can complete the left-right
[Table]
segmentation task for objects with one plane of symmetry. DGCNN network takes roughly about 190 epochs to learn an accurate segmentation, and the Complex-Only network takes about 150 epochs.
Surprisingly, the Complex-Only network (which is rotation equivariant) only does slightly better than the DGCNN (which is not rotation equivariant).
The Shell-Only network takes about 75 epochs to learn an accurate segmentation.
The OAVNN model learns an accurate segmentation faster than all other models.
This shows that when the symmetry detecting features, the complex linear layer, and the attention mechanism are combined, the model can complete the segmentation task the fastest.
Additionally, as shown in Table 1, after training for 200 epochs the OAVNN model obtains the best final testing accuracy.
Thus, both the planar symmetry detection algorithm and the complex linear layer are required to robustly learn the direction of symmetry and complete the symmetric segmentation task.
In Figure 8, we show results of the left-right segmentation experiment run on cap and chair objects.
In both of these cases we again see that the OAVNN model is able to obtain an accurate segmentation the fastest.
However, we do see two interesting behaviors.
First off, only the OAVNN successfully segments the cap objects.
All other models cannot segment the cap objects even after 200 epochs of training.
We expect all networks that are not ambiguous to symmetries, or all networks other than the VNN, to eventually complete the task.
Unlike airplane and chair objects, the models may have a harder time learning how to segment cap objects because there are fewer cap objects in the dataset.
Second, the VNN model accurately segments chair objects after about 50 epochs of training.
We would expect the VNN to be unable to complete the task because the network is ambiguous to symmetric objects like chairs.
In these experiments, the VNN’s behavior could be because the chair objects are not truly symmetric due to sampling issues.
Additionally, it is likely that this behavior is more clearly seen with chair objects because airplane objects are symmetric about the left-right plane and approximately symmetric about the up-down plane.
On the other hand, chairs are only symmetric about the left-right plane and are not approximately symmetric about any other plane.
Therefore, the task of segmenting a chair is most likely easier than the task of segmenting an airplane.