# Improving 3D Object Detection with Channel-wise Transformer

Hualian Sheng1,2 Sijia Cai2 Yuan Liu2 Bing Deng2
Jianqiang Huang2 Xian-Sheng Hua2 Min-Jian Zhao1
1 College of Information Science and Electronic Engineering, Zhejiang
University
2DAMO Academy, Alibaba Group
<EMAIL_ADDRESS>{stephen.csj, alen.ly<EMAIL_ADDRESS>
<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>This
work was done when the author was visiting Alibaba as a research intern. The
code is available at https://github.com/hlsheng1/CT3DCorresponding author.

###### Abstract

Though 3D object detection from point clouds has achieved rapid progress in
recent years, the lack of flexible and high-performance proposal refinement
remains a great hurdle for existing state-of-the-art two-stage detectors.
Previous works on refining 3D proposals have relied on human-designed
components such as keypoints sampling, set abstraction and multi-scale feature
fusion to produce powerful 3D object representations. Such methods, however,
have limited ability to capture rich contextual dependencies among points. In
this paper, we leverage the high-quality region proposal network and a
Channel-wise Transformer architecture to constitute our two-stage 3D object
detection framework (CT3D) with minimal hand-crafted design. The proposed CT3D
simultaneously performs proposal-aware embedding and channel-wise context
aggregation for the point features within each proposal. Specifically, CT3D
uses proposal’s keypoints for spatial contextual modelling and learns
attention propagation in the encoding module, mapping the proposal to point
embeddings. Next, a new channel-wise decoding module enriches the query-key
interaction via channel-wise re-weighting to effectively merge multi-level
contexts, which contributes to more accurate object predictions. Extensive
experiments demonstrate that our CT3D method has superior performance and
excellent scalability. Remarkably, CT3D achieves the AP of 81.77% in the
moderate car category on the KITTI test 3D detection benchmark, outperforms
state-of-the-art 3D detectors.

##  1 Introduction

3D object detection from point clouds is envisioned as an indispensable part
of future Autonomous Vehicle (AV). Unlike the developed 2D detection
algorithms whose success is mainly due to the regular structure of image
pixels, LiDAR point clouds are usually sparse, unordered and unevenly
distributed. This makes the CNN-like operations not well suited to process
unstructured point clouds directly. To tackle these challenges, many
approaches employ voxelization or custom discretization for point clouds.
Several methods [28, 15] project point clouds to a birds-eye view (BEV)
representation and apply the standard 2D convolutions, however, it will
inevitably sacrifice certain geometric details which are vital for generating
accurate localization. Other methods [3, 33] rasterize point clouds into a 3D
voxel grid and use regular 3D CNNs to perform computation in grid space, but
this category of methods suffers from computational bottleneck associated with
making the grid finer. A major breakthrough in detection task on point clouds
is due to the effective deep architectures for point clouds representation
such as volumetric convolution [33] and permutation invariant convolution
[22].

Recently, most state-of-the-art methods for 3D object detection adopt a two-
stage framework consisting of 3D region proposal generation and proposal
feature refinement. Notice that the most popular region proposal network (RPN)
backbone [33] has achieved over 95% recall rate on the KITTI 3D Detection
Benchmark, whereas this method only achieves 78% Average Precision (AP). The
reason for such a gap stems from the difficulty in encoding an object and
extracting the robust feature from 3D proposals in cases of occlusion or long-
range distance. Therefore, how to effectively model geometric relationships
among points and exploit accurate position information during the proposal
feature refinement stage is crucial for good performance. An important family
of models is PointNet [22] and its variants [23, 19, 25], which use a flexible
receptive field to aggregate features by local regions and permutation-
invariant network. However, these methods have the drawback of involving
plenty of hand-crafted designs, such as the neighbor ball radii and the grid
size. Another family of models is the voxel-based methods [33, 27, 39] which
use 3D convolutional kernels to gather information from neighboring voxels.
But the performance of such methods is not optimal caused by the voxel
quantization and sensitive to hyper-parameters. Later studies [43, 24, 4, 10]
further apply the point-voxel mixed strategy to capture multi-scale features
while retaining fine-grained localization but are strongly tied to the
specific RPN architectures.

In this paper, we make two major contributions. First, we propose a novel end-
to-end two-stage 3D objection detection framework called CT3D. Motivated by
the recent Transformer-based 2D detection method DETR [1] that uses CNN
backbone to extract features and encoder-decoder Transformer to enhance the
RoI region features, we design our CT3D to generate 3D bounding boxes at the
first stage, then learn per-proposal representation by incorporating a novel
Transformer architecture with channel-wise re-weighting mechanism in decoder.
The proposed framework exhibits very strong performance in terms of accuracy
and efficiency, and thus can be conveniently combined with any high-quality
RPN backbones.

The second contribution is the custom Transformer that offers several benefits
over the traditional point/voxel-based feature aggregation mechanism. Despite
the point-wise or voxel convolutions have the ability of local and global
context modelling, there still have been several limitations in increasing
receptive field and parameter optimization. In addition, point-cloud based 3D
object detectors also have to deal with the challenging missing/noisy
detections such as occlusion and distancing patterns with a few points. Self-
attention in Transformers has recently emerged as a basic building block for
capturing long-range interactions thus is a natural choice in acquiring
context information for enriching the faraway objects or increasing the
confidence of false negatives. Inspired by this idea, we initially introduce a
proposal-to-point embedding to effectively encode the RPN proposal information
in the encoder module. Furthermore, we exploit a channel-wise re-weighting
approach to augment the standard Transformer decoder in consideration of both
global and local channel-wise features for the encoded points. The purpose is
to scale the feature decoding space where we can compute attention
distribution over each channel dimension of key embeddings thus can enhance
the expressiveness of query-key interactions. Extensive experiments show that
our proposed CT3D can outperform the state-of-the-art published methods on
both the KITTI dataset and the large-scale Waymo dataset.

Figure 1: Overview of CT3D. The raw points are first fed into the RPN for
generating 3D proposals. Then the raw points along with the corresponding
proposals are processed by the channel-wise Transformer composed of the
proposal-to-point encoding module and the channel-wise decoding module.
Specifically, the proposal-to-point encoding module is to modulate each point
feature with global proposal-aware context information. After that, the
encoded point features are transformed into an effective proposal feature
representation by the channel-wise decoding module for confidence prediction
and box regression.

##  2 Related Work

Point Cloud Representations for 3d Object Detection. Recently, there has been
a lot of progress on learning effective representations for the raw LiDAR
point clouds. A noticeable portion of efforts are PointNet series [22] which
employed permutation invariant operations to aggregate the point features.
F-PointNet [21] generated the region-level features for point clouds within
each 3D frustum. PointRCNN [25] used PointNet++ [23] to segment foreground 3D
points and reﬁne the proposals with the segmentation features. STD [37]
further extended the proposal refinement by transferring sparse point features
into dense voxel representation. Moreover, 3DSSD [36] improved the point-based
approach with a new sampling strategy based on feature distance. However,
PointNet-like architectures still present limited ability to capture local
structures for LiDAR data. Another category of methods [3, 13, 34, 35, 28, 15,
12, 16, 17] aimed to voxelize the unstructured point clouds as a regular 2D/3D
grid over which conventional CNNs can be easily applied. Pioneer work [3]
encoded the point clouds as 2D bird-view feature maps to generate highly
accurate 3D candidate boxes, motivating many efﬁcient bird-view
representation-based methods. VoxelNet [43] transformed the points to form a
compact feature representation. SECOND [33] introduced 3D sparse convolution
for efﬁcient 3D voxel processing. These voxel-based methods are still focused
on the subdivision of a volume rather than adaptively modelling local
geometric structure. Furthermore, various point-voxel based methods have been
proposed for multi-scale feature aggregation. SA-SSD [10] presented an
auxiliary network on the basis of 3D voxel CNN. PV-RCNN [24] and its variant
VoxelRCNN [4] adopted 3D voxel CNN as RPN to generate high-quality proposals
and then utilize PointNet to aggregate the voxel features around the grids.
Nevertheless, these hybrid methods require plenty of hand-crafted feature
designs.

Transformers for object detection. A new paradigm for object detection has
recently evolved due to the success of Transformers in many computer vision
fields [1, 44, 5, 9, 6]. Since Transformer models are very effective at
learning local context-aware representations, DETR [1] viewed the detection as
a set prediction problem and employed Transformer with parallel decoding to
detect objects in 2D image. A variant of DETR [44] further developed a
deformable attention module to employ cross-scale aggregation. For point
clouds, recent methods [9, 6] also explored to use self-attention for
classiﬁcation and segmentation tasks.

##  3 CT3D for 3D Object Detection

Given proposals generated by the widely used RPN backbones like 3D voxel CNN
[33], current state-of-the-art proposal refinement approaches [24, 4] focus on
refining the intermediate multi-stage voxel features extracted by the
convolution layers, suffering the difficulties of extra hyper-parameter
optimization and designing generalized models. We believe that the raw points
with precise position information are sufficient for refining the detection
proposals. Bearing this view in mind, we construct our CT3D framework by
deploying a well-designed Transformer on top of a RPN network to directly
utilize the raw point clouds. Specifically, the whole CT3D detection framework
is composed of three parts, i.e., a RPN backbone for proposal generation, a
channel-wise Transformer for proposal feature refinement and a detect head for
object predictions. Figure 1 illustrates an overview of our CT3D framework.

###  3.1 RPN for 3D Proposal Generation

Starting from the point clouds P with 3-dimension coordinates and
$C$-dimension point features, the predicted 3D bounding box generated by RPN
consists of center coordinate $\bm{p}^{c}=[x^{c},y^{c},z^{c}]$, length
$l^{c}$, width $w^{c}$, height $h^{c}$, and orientation $\theta^{c}$. In this
paper, we adopt the 3D voxel CNN SECOND [33] as our default RPN due to its
high efficiency and accuracy. Note that any high-quality RPN should be readily
replaceable in our framework and is amenable to training via an end-to-end
manner.

###  3.2 Proposal-to-point Encoding Module

To refine the generated RPN proposals, we adopt a two-step strategy.
Specifically, the first proposal-to-point embedding step maps the proposal to
point features, then the second self-attention encoding step is to refine
point features via modelling the relative relationships among points within
the corresponding proposal.

Proposal-to-point Embedding. Given the proposals generated by RPN, we delimit
out a scaled RoI area in point clouds according to the proposal. This aims to
compensate the deviation between the proposal and the corresponding ground-
truth box by wrapping all object points as much as possible. Specifically, the
scaled RoI area is a cylindrical with unlimited height and a radius
$r=\alpha\sqrt{(\frac{l^{c}}{2})^{2}+(\frac{w^{c}}{2})^{2}}$, where $\alpha$
is a hyper-parameter, and $l$, $w$ denote the length and width of the
proposal, respectively. Hereinafter, the randomly sampled $N=256$ points
within the scaled RoIs ($\mathcal{N}=\\{\bm{p}_{1},\dots,\bm{p}_{N}\\}$ ) are
taken out for further processing.

At first, we calculate the relative coordinates between each sampled point and
the center point of the proposal for unifying the input distance feature,
denoted as
$\Delta\bm{p}_{i}^{c}=\bm{p}_{i}-\bm{p}^{c},\forall\bm{p}_{i}\in\mathcal{N}$.
A straightforward thought is to directly concatenate the proposal information
into each point feature, i.e.,
$[\Delta\bm{p}_{i}^{c},l^{c},w^{c},h^{c},\theta^{c},f_{i}^{r}]$, where
$f_{i}^{r}$ is the raw point feature such as reflection. However, the size-
orientation representation for proposal yields only modest performance as the
Transformer encoder might be less effective to reorient in accord with above-
mentioned geometric information.

It is noteworthy that the keypoints usually offer more explicit geometry
property in detection tasks [41, 14], we propose a novel keypoints subtraction
strategy to compute the relative coordinates between each point and the eight
corner points of the corresponding proposal. The calculated relative
coordinates are $\Delta\bm{p}_{i}^{j}=\bm{p}_{i}-\bm{p}^{j},j=1,\dots,8$,
where $\bm{p}^{j}$ is the coordinate of the $j$-th corner point. Note that
$l^{c},w^{c},h^{c}$ and $\theta^{c}$ disappear but are contained in different
dimensions of distance information. Through this way, the newly generated
relative coordinates $\Delta\bm{p}_{i}^{j}$ can be viewed as a better
representation of proposal information. As shown in the left part of Figure 2,
for each point $\bm{p}_{i}$, the proposal-guided point feature can be
expressed as:

$\displaystyle\bm{f}_{i}=\mathcal{A}([\Delta\bm{p}_{i}^{c},\Delta\bm{p}_{i}^{1},\dots,\Delta\bm{p}_{i}^{8},f_{i}^{r}])\in\mathbb{R}^{D},$
(1)

where $\mathcal{A}(\cdot)$ is a linear projection layer to map point feature
into a high-dimensional embedding.

Figure 2: Proposal-to-point encoding. The location features of raw point
clouds are first modulated by the proposal information (center and corners)
via subtraction operator. Then, the resulting point features are refined by
the proposal-aware encoding module with multi-head self-attention mechanism.

Self-attention Encoding. The embeded point features are then fed into the
multi-head self-attention layer, followed by a feed-forward network (FFN) with
residual structure, to encode rich contextual relationships and point
dependencies in proposal for refining point features. As shown in the right
part of Figure 2, this self-attention encoding scheme shares almost the same
structure as the original NLP Transformer encoder, except for the position
embedding since it is already included in the point features. Reader can refer
to [31] for more details. Denote
$\mathbf{X}=[\bm{f}_{1}^{T},\dots,\bm{f}_{N}^{T}]^{T}\in\mathbb{R}^{N\times
D}$ as the embedded point features with the dimension $D$, we have
$\mathbf{Q}=\mathbf{W}_{q}\mathbf{X};\ \ \mathbf{K}=\mathbf{W}_{k}\mathbf{X};\
\ \mathbf{V}=\mathbf{W}_{v}\mathbf{X},$ where
$\mathbf{W}_{q},\mathbf{W}_{k},\mathbf{W}_{v}\in\mathbb{R}^{N\times N}$ are
linear projections, and $\mathbf{Q},\mathbf{K}$ and $\mathbf{V}$ are so-called
query, key and value embeddings. These three embeddings are then processed by
multi-head self-attention mechanism. In a $H$-head attention situation,
$\mathbf{Q},\mathbf{K}$ and $\mathbf{V}$ are further divided into
$\mathbf{Q}=[\mathbf{Q}_{1},\dots,\mathbf{Q}_{H}]$,
$\mathbf{K}=[\mathbf{K}_{1},\dots,\mathbf{K}_{H}]$, and
$\mathbf{V}=[\mathbf{V}_{1},\dots,\mathbf{V}_{H}]$, where
$\mathbf{Q}_{h},\mathbf{K}_{h},\mathbf{V}_{h}\in\mathbb{R}^{N\times
D^{\prime}},\forall h=1,\dots,H$, and $D^{\prime}=\frac{D}{H}$. The output
after multi-head self-attention is given by:

$\displaystyle\text{S}^{\text{(att)}}(\mathbf{Q},\mathbf{K},\mathbf{V})=\bigg{[}\sigma\big{(}\frac{\mathbf{Q}_{h}\mathbf{K}_{h}^{T}}{\sqrt{D^{\prime}}}\big{)}\cdot\mathbf{V}_{h}\bigg{]},h=1,\dots,H,$
(2)

where $\sigma(\cdot)$ is softmax function. Hereinafter, applying a simple FFN
and residual operator, the result is as follows:

$\displaystyle\text{S}^{\text{(emb)}}(\mathbf{X})=\mathcal{Z}(\mathcal{F}(\mathcal{Z}(\text{S}^{\text{(att)}}(\mathbf{Q},\mathbf{K},\mathbf{V})))),$
(3)

where $\mathcal{Z}(\cdot)$ denotes add and normalization operator,
$\mathcal{F}(\cdot)$ denotes a FFN with two linear layers and one Relu
activation. We observe that a stack of 3 identical self-attention encoding
modules is ideal for our CT3D framework.

###  3.3 Channel-wise Decoding Module

In this subsection, we manage to decode all point features (i.e.,
$\hat{\mathbf{X}}$) from the encoder module into a global representation,
which is further processed by FFNs for the final detection predictions.
Different from the standard Transformer decoder, which transforms $M$ multiple
query embeddings using self- and encoder-decoder attention mechanism, our
decoder only manipulates one query embedding according to the following two
facts:

  * •

$M$ query embeddings suffer high memory latency, especially for processing
with numbers of proposals.

  * •

$M$ query embeddings are usually independently transformed into $M$ words or
objects, while our proposal refinement model only needs one prediction.

Generally, the final proposal representation after decoder can be regarded as
a weighted sum of all point features, our key motivation is to determine the
decoding weights that are dedicated for each point. In below, we first analyze
the standard decoding scheme, and then develop an improved decoding scheme to
acquire more effective decoding weights.

Standard Decoding. The standard decoding scheme utilizes a learnable vector
(i.e., query embedding) of dimension $D$ to aggregate the point features
across all channels. As shown in Figure 3(a), the final decoding weight vector
for all point features in each attention head is:

$\displaystyle\bm{w}_{h}^{(S)}=\sigma\big{(}\frac{\hat{\bm{q}}_{h}\hat{\mathbf{K}}_{h}^{T}}{\sqrt{D^{\prime}}}\big{)},h=1,\dots,H,$
(4)

where $\hat{\mathbf{K}_{h}}$ is the key embeddings of $h$-th head computed by
the projection of encoder output, and $\hat{\bm{q}}_{h}$ is the corresponding
query embedding. Note that each value of vector
$\hat{\bm{q}}_{h}\hat{\mathbf{K}}_{h}^{T}$ can be viewed as the global
aggregation for individual point (i.e., each key embedding), and the
subsequent softmax function assigns the decoding value for each point
according to the probability in the normalized vector. Consequently, the
values in decoding weight vector are derived from simple global aggregation
and lack the local channel-wise modelling, which is essential to learn 3D
surface structures of point clouds because different channels usually exhibit
strong geometric relationships in point clouds.

Channel-wise Re-weighting. In order to emphasize the channel-wise information
for key embeddings $\hat{\mathbf{K}}_{h}^{T}$, a straightforward solution is
to compute the decoding weight vector for points based on all the channels of
$\hat{\mathbf{K}}_{h}^{T}$. That is, we generate $D$ different decoding weight
vectors for each channel to obtain $D$ decoding values. Further, a linear
projection is introduced for these $D$ decoding values to form a united
channel-wise decoding vector. As shown in Figure 3(b), this new channel-wise
re-weighting for decoding weight vector can be summarized as:

$\displaystyle\bm{w}_{h}^{(C)}=\bm{s}\cdot\hat{\sigma}\big{(}\frac{\hat{\mathbf{K}}_{h}^{T}}{\sqrt{D^{\prime}}}\big{)},h=1,\dots,H,$
(5)

where $\bm{s}$ is a linear projection that compresses $D^{\prime}$ number of
decoding values into a re-weighting scalar, $\hat{\sigma}(\cdot)$ computes the
softmax along the $N$ dimension. However, the decoding weights computed by
$\hat{\sigma}(\cdot)$ are associated with each channel, and thus ignore the
global aggregation of each point. Therefore, we can conclude that the standard
decoding scheme focuses on global aggregation while the channel-wise re-
weighting scheme concentrates on the channel-wise local aggregation. To
combine their characteristics, we propose an extended channel-wise re-
weighting scheme as below.

Figure 3: Illustration of the different decoding schemes: (a) Standard
decoding; (b) Channel-wise re-weighting; (c) Extended channel-wise re-
weighting.

Extended Channel-wise Re-weighting. Specifically, we first repeat the matrix
product of query embedding and key embeddings to spread the spatial
information into each channel, and the output is then multiplied element-wise
with the key embeddings for keeping the channel differences. As illustrated in
Figure 3 (c), this novel extended channel-wise re-weighting scheme generates
the following decoding weight vector for all the points:

$\displaystyle\bm{w}_{h}^{(EC)}=\bm{s}\cdot\hat{\sigma}\big{(}\frac{\rho(\hat{\bm{q}}_{h}\hat{\mathbf{K}}_{h}^{T})\odot\hat{\mathbf{K}}_{h}^{T}}{\sqrt{D^{\prime}}}\big{)},h=1,\dots,H,$
(6)

where $\rho(\cdot)$ is a repeat operator makes $\mathbb{R}^{1\times
N}\to\mathbb{R}^{D^{\prime}\times N}$. In this way, we can not only maintain
the global information as compared to the channel-wise re-weighting scheme,
but also enrich the local and detailed channel interactions as compared to the
standard decoding scheme. Besides, this extended channel-wise re-weighting
only brings 1K+ (Bytes) increase as compared to the other two schemes. As a
result, the final decoded proposal representation can be described as follows:

$\displaystyle\bm{y}=[\bm{w}_{1}^{(EC)}\cdot\hat{\mathbf{V}}_{1},\dots,\bm{w}_{H}^{(EC)}\cdot\hat{\mathbf{V}}_{H}],$
(7)

where the value embeddings $\hat{\mathbf{V}}$ is the linear projection
obtained from $\hat{\mathbf{X}}$.

###  3.4 Detect head and Training Targets

In the previous steps, the input point features are summarized into a
$D$-dimension vector $\bm{y}$, which is then fed into two FFNs for predicting
the confidence and the box residuals relative to the input 3D proposal,
respectively.

To output the confidence, training targets are set as the 3D IoU between the
3D proposals and their corresponding ground-truth boxes. Given the IoU of the
3D proposal and its corresponding ground-truth box, we follow [11, 25, 24] to
assign the confidence prediction target, which is shown as:

$\displaystyle
c^{t}=\min\bigg{(}1,\max\big{(}0,\frac{\text{IoU}-\alpha_{B}}{\alpha_{F}-\alpha_{B}}\big{)}\bigg{)},$
(8)

where $\alpha_{F}$ and $\alpha_{B}$ are the foreground and background IoU
thresholds, respectively. Besides, regression targets (superscript $t$) are
encoded by proposals and their corresponding ground-truth boxes (superscript
$g$), given by:

$\displaystyle
x^{t}=\frac{x^{g}-x^{c}}{d},y^{t}=\frac{y^{g}-y^{c}}{d},z^{t}=\frac{z^{g}-z^{c}}{h^{c}},$
$\displaystyle
l^{t}=\log{(\frac{l^{g}}{l^{c}})},w^{t}=\log{(\frac{w^{g}}{w^{c}})},h^{t}=\log{(\frac{h^{g}}{h^{c}})},$
$\displaystyle\theta^{t}=\theta^{g}-\theta^{c},$ (9)

where $d=\sqrt{(l^{c})^{2}+(w^{c})^{2}}$ is the diagonal of the base of the
proposal box.

###  3.5 Training Losses

We adopt an end-to-end strategy to train CT3D. Hence, the overall training
loss is the summation of the RPN loss, the confidence prediction loss, and the
box regression loss, which is presented:

$\displaystyle\mathcal{L}=\mathcal{L}_{\text{RPN}}+\mathcal{L}_{\text{conf}}+\mathcal{L}_{\text{reg}}.$
(10)

Here, the binary cross entropy loss [11, 35] is exploited for the predicted
confidence $c$ to compute the IoU-guided confidence loss:

$\displaystyle\mathcal{L}_{\text{conf}}=-c^{t}\log{(c)}-(1-c^{t})\log{(1-c)}.$
(11)

Moreover, the box regression loss [35, 33] adopts:

$\displaystyle\mathcal{L}_{\text{reg}}=\mathbb{I}(\text{IoU}\geq\alpha_{R})\sum_{\mu\in{x,y,z,l,w,h,\theta}}{\mathcal{L}_{\text{smooth-L1}}}(\mu,\mu^{t}),$
(12)

where $\mathbb{I}(\text{IoU}\geq\alpha_{R})$ indicates that only proposals
with $\text{IoU}\geq\alpha_{R}$ contribute to the regression loss.

##  4 Experiments

In this section, we evaluate our CT3D on two public datasets, KITTI [7] and
Waymo [18, 42]. Furthermore, we conduct comprehensive ablation studies to
verify the effectiveness of each module in CT3D.

###  4.1 Dataset

KITTI Dataset. KITTI dataset officially contains 7,481 training LiDAR samples
and 7,518 testing LiDAR samples. Following the previous work [2], we split the
original training data into 3,712 training samples and 3,769 validation
samples for experimental studies.

Waymo Dataset. Waymo dataset consists of 798 training sequences with around
158,361 LiDAR samples, and 202 validation sequences with 40,077 LiDAR samples.
This large-scale Waymo dataset detection task is more challenging due to its
various autonomous driving scenarios [42].

###  4.2 Implementation Details

RPN. We adopt SECOND [33] as our RPN due to its high-quality proposals and
fast speed of inference. For the KITTI dataset, the $X,Y,Z$ axis ranges are
set as $(0,70.4)$, $(-40,40)$, $(-3,1)$, and the voxel size is set as
$(0.05\text{m},0.05\text{m},0.1\text{m})$ in
$(X\text{-axis},Y\text{-axis},Z\text{-axis})$. For the Waymo dataset, the
corresponding axis ranges are $(-75.2,75.2)$, $(-75.2,75.2)$, $(-2,4)$, and
the voxel size is $(0.1\text{m},0.1\text{m},0.15\text{m})$.
$\mathcal{L}_{\text{RPN}}$ consists of the Focal-Loss classification branch
and the Smooth-L1-Loss based regression branch. Please refer to OpenPCDet [30]
for more details since we conduct our experiments with this toolbox.

Method | Par. | 3D Detection - Car
---|---|---
(M) | Easy | Mod. | Hard
LiDAR & RGB
MV3D, CVPR 2017 [3] | - | 74.97 | 63.63 | 54.00
ContFuse, ECCV 2018 [17] | - | 83.68 | 68.78 | 61.67
AVOD-FPN, IROS 2018 [12] | - | 83.07 | 71.76 | 65.73
F-PointNet, CVPR 2018 [21] | 40 | 82.19 | 69.79 | 60.59
UberATG-MMF, CVPR 2019 [16] | - | 88.40 | 77.43 | 70.22
3D-CVF at SPA, ECCV 2020 [38] | - | 89.20 | 80.05 | 73.11
CLOCs, IROS 2020 [20] | - | 88.94 | 80.67 | 77.15
LiDAR only
SECOND, Sensor 2018 [33] | 20 | 83.34 | 72.55 | 65.82
PointPillars, CVPR 2019 [13] | 18 | 82.58 | 74.31 | 68.99
STD, ICCV 2019 [37] | - | 87.95 | 79.71 | 75.09
PointRCNN, CVPR 2019 [25] | 16 | 86.96 | 75.64 | 70.70
3D IoU Loss, 3DV 2019 [40] | - | 86.16 | 76.50 | 71.39
Part-$A^{2}$, PAMI 2020 [26] | 226 | 87.81 | 78.49 | 73.51
SA-SSD, CVPR 2020 [10] | 40.8 | 88.75 | 79.79 | 74.16
3DSSD, CVPR 2020 [36] | - | 88.36 | 79.57 | 74.55
PV-RCNN, CVPR 2020 [24] | 50 | 90.25 | 81.43 | 76.82
Voxel-RCNN, AAAI 2021 [4] | 28 | 90.90 | 81.62 | 77.06
CT3D (Ours) | 30 | 87.83 | 81.77 | 77.16
Table 1: Performance comparisons with state-of-the-art methods on the KITTI test set. All results are reported by the average precision with 0.7 IoU threshold and 40 recall positions. Method | 3D Detection - Car
---|---
Easy | Mod. | Hard
LiDAR & RGB
MV3D, CVPR 2017 [3] | 71.29 | 62.68 | 56.56
ContFuse, ECCV 2018 [17] | - | 73.25 | -
AVOD-FPN, IROS 2018 [12] | - | 74.44 | -
F-PointNet, CVPR 2018 [21] | 83.76 | 70.92 | 63.65
3D-CVF at SPA, ECCV 2020 [38] | 89.67 | 79.88 | 78.47
LiDAR only
SECOND, Sensor 2018 [33] | 88.61 | 78.62 | 77.22
PointPillars, CVPR 2019 [13] | 86.62 | 76.06 | 68.91
STD, ICCV 2019 [37] | 89.70 | 79.80 | 79.30
PointRCNN, CVPR 2019 [25] | 88.88 | 78.63 | 77.38
SA-SSD, CVPR 2020 [10] | 90.15 | 79.91 | 78.78
3DSSD, CVPR 2020 [36] | 89.71 | 79.45 | 78.67
PV-RCNN, CVPR 2020 [24] | 89.35 | 83.69 | 78.70
Voxel-RCNN, AAAI 2021 [4] | 89.41 | 84.52 | 78.93
CT3D (Ours) | 89.54 | 86.06 | 78.99
Table 2: Performance comparisons with state-of-the-art methods on the KITTI val set. All results are reported by the average precision with 0.7 IoU threshold and 11 recall positions. IoU | BEV Detection | 3D Detection
---|---|---
Thr. | Easy | Mod. | Hard | Easy | Mod. | Hard
0.7 | 96.14 | 91.88 | 89.63 | 92.85 | 85.82 | 83.46
Table 3: Performance of our CT3D on the KITTI val set with AP calculated by 40 recall positions for car category.  IoU | Pedestrian | Cyclist
---|---|---
Thr. | Easy | Mod. | Hard | Easy | Mod. | Hard
0.5 | 65.73 | 58.56 | 53.04 | 91.99 | 71.60 | 67.34
Table 4: Performance for pedestrian and cyclist on the KITTI.  Difficulty | Method | 3D Detection - Vehicle | BEV Detection - Vehicle
---|---|---|---
Overall | 0-30m | 30-50m | 50m-Inf | Overall | 0-30m | 30-50m | 50m-Inf
LEVEL_1 |  PointPillar, CVPR 2019 [13] | 56.62 | 81.01 | 51.75 | 27.94 | 75.57 | 92.10 | 74.06 | 55.47
MVF, CoRL 2020 [42] | 62.93 | 86.30 | 60.02 | 36.02 | 80.40 | 93.59 | 79.21 | 63.09
Pillar-OD, arXiv 2020 [32] | 69.80 | 88.53 | 66.50 | 42.93 | 87.11 | 95.78 | 84.87 | 72.12
PV-RCNN, CVPR 2020 [24] | 70.30 | 91.92 | 69.21 | 42.17 | 82.96 | 97.35 | 82.99 | 64.97
Voxel-RCNN, AAAI 2021 [4] | 75.59 | 92.49 | 74.09 | 53.15 | 88.19 | 97.62 | 87.34 | 77.70
CT3D (Ours) | 76.30 | 92.51 | 75.07 | 55.36 | 90.50 | 97.64 | 88.06 | 78.89
LEVEL_2 |  PV-RCNN, CVPR 2020 [24] | 65.36 | 91.58 | 65.13 | 36.46 | 77.45 | 94.64 | 80.39 | 55.39
Voxel-RCNN, AAAI 2021 [4] | 66.59 | 91.74 | 67.89 | 40.80 | 81.07 | 96.99 | 81.37 | 63.26
CT3D (Ours) | 69.04 | 91.76 | 68.93 | 42.60 | 81.74 | 97.05 | 82.22 | 64.34
Table 5: Performance comparisons with state-of-the-art methods on the Waymo
dataset with 202 validation sequences ($\sim$ 40k samples) for vehicle
detection.

Training Details. We use 8 $\text{V}100$ GPUs to train the entire network with
batch size $24$ for the KITTI dataset and batch size $16$ for Waymo dataset.
For the encoder and decoder modules of channel-wise transformer, we set
$\alpha=1.2$ and $H=4$. For training targets, we set
$\alpha_{F}=0.75,\alpha_{B}=0.25,\alpha_{R}=0.55$, respectively. The whole
CT3D framework is trained end-to-end from scratch with ADAM optimizer for 100
epochs. We adopt cosine annealing learning rate strategy for our learning rate
decay, and the maximum of leaning rate is 0.001. In the training stage, only
128 proposals are randomly selected to calculate the confidence loss while 64
($\text{IoU}\geq\alpha_{R}$) proposals are selected to calculate the
regression loss. In the inference stage, top-100 proposals are selected for
the final prediction.

###  4.3 Detection Results on the KITTI Dataset

We compare our CT3D with state-of-the-art methods on both the KITTI test and
val sets with 0.7 IoU threshold. For our test submission, all the released
training data is used to train the model. Following [25, 24, 4, 10], the
average precision (AP) for test set is calculated with 40 recall positions,
while the AP for val set is calculated with 11 recall positions when compared
to the previous methods111The setting of AP calculation is modified from 11
recall positions to 40 recall positions on 08.10.2019. For fair comparison
with previous methods, we exploit the 11 recall setting on val set..

Performance Comparisons. Table 1 illustrates the performance comparisons
between our method and state-of-the-art methods on the official KITTI test
server. It shows CT3D achieves the best performance on moderate and hard
levels for car detection on both LiDAR only and Lidar&RGB modalities,
especially for the most important moderate level [8]. Compared with the newest
released PV-RCNN which shares the same RPN (i.e., SECOND) as ours, CT3D
achieves better performance while requiring about 1/3 times of parameters for
refinement. Besides, as shown in Figure 4, CT3D presents much better
visualization performance as compared to the PV-RCNN. This significant
improvement mainly comes from the fact that CT3D processes the raw points in
refinement stage rather than relying on human-specified designs and sub-
optimal intermediate features. Note the AP on easy level of our CT3D is
comparatively worse, there might be two reasons. First, we only sample 256 raw
point within each proposal for all levels even the proposals in easy level
usually have a much larger number of points. Second, we observe that KITTI
exhibits large distribution differences between trainval and test sets.

For further validation, we conduct comparisons with previous methods on the
KITTI val set. It shows that our CT3D outperforms all the other methods with a
large margin, leading the state-of-the-art method Voxel-RCNN by 1.54% on
moderate level, and achieves the competitive result on easy level. This
improvement also verifies the effectiveness of our method, indicating our CT3D
could better model the context information and dependencies as compared to the
methods based on multi-scale feature fusion. Our model can also achieve strong
performance on pedestrian and cyclist detection. The car-BEV, pedestrian-3D
and cyclist-3D results are presented in Table 3 and Table 4 for reference.

###  4.4 Detection Results on the Waymo Dataset

As for the Waymo dataset, we train our model on the training set and evaluate
it on the validation set. Likewise, the mAP is calculated with $0.7$ IoU
threshold for vehicle detection. The data is split into two difficulty levels:
LELVEL_1 denotes objects containing more than 5 points , LELVEL_2 denotes
objects containing $1\sim 5$ points.

Performance Comparisons. In Table 5, we compare our CT3D with state-of-the-art
methods based on official released evaluation tools [29]. It can be seen that
our method outperforms all previous methods with remarkable margins on all
distance ranges of interest in both LEVEL_1 and LEVEL_2. CT3D achieves 76.30%
for the commonly used LEVEL_1 3D mAP evaluation metric, surpassing previous
state-of-the-art method Voxel-RCNN by 0.71% on 3D detection, and 2.31% on
bird-view detection. This significant improvement also verifies the
effectiveness of our CT3D approach on large-scale point cloud feature
representation. We report the results of LEVEL_2 difficulty in Table 5, our
method outperforms Voxel-RCNN significantly by 2.45% on 3D detection. A
contributing factor is that Voxel-RCNN limits the feature interactions via
dividing the RoI space into grids, while our proposed CT3D has the obvious
advantage of capturing long-range interactions among sparse points.

Figure 4: Qualitative comparison results of 3D object detection on the KITTI
test set. Our CT3D enables more reasonable and accurate detection as compared
to the PV-RCNN. Figure 5: Attention maps generated by the self-attention
layer. We visualize the weights of at most 256 sampled points within 3 RoIs
(red dotted line) as the $30$-th and $80$-th epochs.

###  4.5 Ablation Studies

In this section, we conduct comprehensive ablation studies for the CT3D to
verify the effectiveness of each individual component. We report the 3D
detection AP metric with 40 recall positions on the KITTI val set.

Different RPN Backbones. In Table 6, we validate the effects of our refinement
network with “SECOND RPN [33],” and “PointPillar RPN [13]”, respectively. It
can be seen that the detection performance boosts with +5.47% and +4.82% when
compared to the RPN baselines. This benefits from that our two-stage framework
CT3D could be integrated on the top of any RPNs to provide strong ability for
proposal refinement. We also provide the amount of parameters in Table 6 for
reference.

Proposal-to-point Embedding. We investigate the importance of the keypoints
subtraction strategy by comparing it with the baseline size-orientation
strategy adopted in the proposal-to-point embedding of Sec. 3.2. The $2^{nd}$
and $3^{rd}$ rows of Table 7 show that keypoints subtraction approach
significantly improves the performance in all three difficulty levels. The
rationale behind this strategy is that the relative coordinates between each
point and the proposal keypoints could provide more effective geometric
information, forming high-quality point location embeddings.

Self-attention Encoding. The $1^{st}$ and $3^{rd}$ rows of Table 7 show that
removing the self-attention encoding drops performance a lot, which
demonstrates that the self-attention enables better feature representation for
each point by aggregating the global-aware context information and
dependencies. Moreover, we visualize the attention maps of the last self-
attention layer of a trained model from different epoch checkpoints. As shown
in Figure 5, the points on cars get more attention in epoch 80, even in an
extremely sparse case as Figure 5 (c). On the contrary, the background points
get less attention with the training process. Therefore, CT3D pays more
attention to foreground points, and thus achieves considerable performance.

Channel-wise Decoding. As shown in the $3^{rd}$, $4^{th}$ and $5^{th}$ rows of
Table 7, the extended channel-wise re-weighting outperforms both the standard
decoding and channel-wise re-weighting with a large margin. This benefits from
the integration of the standard decoding and the channel-wise re-weighting for
both global and channel-wise local aggregation, generating more effective
decoding weights.

##  5 Conclusion

In this paper, we present a two-stage 3D object detection framework CT3D with
a novel channel-wise Transformer architecture. Our method first encodes the
proposal information into each raw point via an efficient proposal-to-point
embedding, followed by self-attention to capture the long-range interactions
among points. Subsequently, we transform the encoded point features into a
global proposal-aware representation by an extended channel-wise re-weighting
scheme which could obtain effective decoding weights for all points. The CT3D
provides a flexible and highly-effective framework which is particularly
helpful for point cloud detection tasks. Experimental results on both the
KITTI dataset and the large-scale Waymo dataset also verify that CT3D could
achieve significant improvement over the state-of-the-art methods.

PointPillar | SECOND | Two-stage | Par. | Moderate AP (%)
---|---|---|---|---
RPN | RPN | refinement | (M)
✓ |  |  | 18 | 79.26
✓ |  | ✓ | 28 | 84.08
| ✓ |  | 20 | 80.35
| ✓ | ✓ | 30 | 85.82
Table 6: Ablation studies for different RPNs on the KITTI val set in terms of 3D detection AP metric with 40 recall positions.  K. S. | S. E. | S. D. | C. R. | E. C. R | Easy | Mod. | Hard
---|---|---|---|---|---|---|---
✓ |  | ✓ |  |  | 90.29 | 79.20 | 74.59
| ✓ | ✓ |  |  | 91.92 | 83.41 | 81.79
✓ | ✓ | ✓ |  |  | 92.09 | 85.10 | 82.98
✓ | ✓ |  | ✓ |  | 92.56 | 85.34 | 83.23
✓ | ✓ |  |  | ✓ | 92.85 | 85.82 | 83.46
Table 7: Ablation studies for proposal-to-point embedding, self-attention
encoding and channel-wise decoding on the KITTI val set. “K. S.” stands for
the keypoints subtraction strategy, “S. E.” stands for the self-attention
encoding, “S. D.”, “C. R.” and “E. C. R.” represent the standard decoding,
channel-wise re-weighting, and our extended channel-wise re-weighting,
respectively.

## Acknowledgements

This work was supported by Alibaba Innovative Research (AIR) progamm and Major
Scientifc Research Project of Zhejiang Lab (No. 2019DB0ZX01).

## References

  * [1] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko.  End-to-end object detection with transformers.  In Proceedings of the European Conference on Computer Vision (ECCV), pages 213–229, 2020.
  * [2] Xiaozhi Chen, Kaustav Kundu, Yukun Zhu, Andrew G Berneshawi, Huimin Ma, Sanja Fidler, and Raquel Urtasun.  3d object proposals for accurate object class detection.  Advances in Neural Information Processing Systems (NIPS), 28:424–432, 2015.
  * [3] Xiaozhi Chen, Huimin Ma, Ji Wan, Bo Li, and Tian Xia.  Multi-view 3d object detection network for autonomous driving.  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1907–1915, 2017.
  * [4] Jiajun Deng, Shaoshuai Shi, Peiwei Li, Wengang Zhou, Yanyong Zhang, and Houqiang Li.  Voxel r-cnn: Towards high performance voxel-based 3d object detection.  arXiv preprint arXiv:2012.15712, 2020.
  * [5] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al.  An image is worth 16x16 words: Transformers for image recognition at scale.  arXiv preprint arXiv:2010.11929, 2020.
  * [6] Nico Engel, Vasileios Belagiannis, and Klaus Dietmayer.  Point transformer.  arXiv preprint arXiv:2011.00931, 2020.
  * [7] Andreas Geiger, Philip Lenz, Christoph Stiller, and Raquel Urtasun.  Vision meets robotics: The kitti dataset.  The International Journal of Robotics Research, 32(11):1231–1237, 2013.
  * [8] Andreas Geiger, Philip Lenz, and Raquel Urtasun.  Are we ready for autonomous driving? the kitti vision benchmark suite.  In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition (CVPR), pages 3354–3361, 2012.
  * [9] Meng-Hao Guo, Jun-Xiong Cai, Zheng-Ning Liu, Tai-Jiang Mu, Ralph R Martin, and Shi-Min Hu.  Pct: Point cloud transformer.  arXiv preprint arXiv:2012.09688, 2020.
  * [10] Chenhang He, Hui Zeng, Jianqiang Huang, Xian-Sheng Hua, and Lei Zhang.  Structure aware single-stage 3d object detection from point cloud.  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 11873–11882, 2020.
  * [11] Borui Jiang, Ruixuan Luo, Jiayuan Mao, Tete Xiao, and Yuning Jiang.  Acquisition of localization confidence for accurate object detection.  In Proceedings of the European Conference on Computer Vision (ECCV), pages 784–799, 2018.
  * [12] Jason Ku, Melissa Mozifian, Jungwook Lee, Ali Harakeh, and Steven L Waslander.  Joint 3d proposal generation and object detection from view aggregation.  In 2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 1–8, 2018.
  * [13] Alex H Lang, Sourabh Vora, Holger Caesar, Lubing Zhou, Jiong Yang, and Oscar Beijbom.  Pointpillars: Fast encoders for object detection from point clouds.  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 12697–12705, 2019.
  * [14] Hei Law and Jia Deng.  Cornernet: Detecting objects as paired keypoints.  In Proceedings of the European Conference on Computer Vision (ECCV), pages 734–750, 2018.
  * [15] Bo Li, Tianlei Zhang, and Tian Xia.  Vehicle detection from 3d lidar using fully convolutional network.  arXiv preprint arXiv:1608.07916, 2016.
  * [16] Ming Liang, Bin Yang, Yun Chen, Rui Hu, and Raquel Urtasun.  Multi-task multi-sensor fusion for 3d object detection.  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 7345–7353, 2019.
  * [17] Ming Liang, Bin Yang, Shenlong Wang, and Raquel Urtasun.  Deep continuous fusion for multi-sensor 3d object detection.  In Proceedings of the European Conference on Computer Vision (ECCV), pages 641–656, 2018.
  * [18] Jiquan Ngiam, Benjamin Caine, Wei Han, Brandon Yang, Yuning Chai, Pei Sun, Yin Zhou, Xi Yi, Ouais Alsharif, Patrick Nguyen, et al.  Starnet: Targeted computation for object detection in point clouds.  arXiv preprint arXiv:1908.11069, 2019.
  * [19] Xuran Pan, Zhuofan Xia, Shiji Song, Li Erran Li, and Gao Huang.  3d object detection with pointformer.  arXiv preprint arXiv:2012.11409, 2020.
  * [20] Su Pang, Daniel Morris, and Hayder Radha.  Clocs: Camera-lidar object candidates fusion for 3d object detection.  In 2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2020.
  * [21] Charles R Qi, Wei Liu, Chenxia Wu, Hao Su, and Leonidas J Guibas.  Frustum pointnets for 3d object detection from rgb-d data.  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 918–927, 2018.
  * [22] Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas.  Pointnet: Deep learning on point sets for 3d classification and segmentation.  In Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR), pages 652–660, 2017.
  * [23] Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas.  Pointnet++: Deep hierarchical feature learning on point sets in a metric space.  Advances in Neural Information Processing Systems (NIPS), 30:5099–5108, 2017.
  * [24] Shaoshuai Shi, Chaoxu Guo, Li Jiang, Zhe Wang, Jianping Shi, Xiaogang Wang, and Hongsheng Li.  Pv-rcnn: Point-voxel feature set abstraction for 3d object detection.  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 10529–10538, 2020.
  * [25] Shaoshuai Shi, Xiaogang Wang, and Hongsheng Li.  Pointrcnn: 3d object proposal generation and detection from point cloud.  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–779, 2019.
  * [26] Shaoshuai Shi, Zhe Wang, Jianping Shi, Xiaogang Wang, and Hongsheng Li.  From points to parts: 3d object detection from point cloud with part-aware and part-aggregation network.  IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 2020.
  * [27] Shuran Song and Jianxiong Xiao.  Deep sliding shapes for amodal 3d object detection in rgb-d images.  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 808–816, 2016.
  * [28] Hang Su, Subhransu Maji, Evangelos Kalogerakis, and Erik Learned-Miller.  Multi-view convolutional neural networks for 3d shape recognition.  In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 945–953, 2015.
  * [29] Pei Sun, Henrik Kretzschmar, Xerxes Dotiwalla, Aurelien Chouard, Vijaysai Patnaik, Paul Tsui, James Guo, Yin Zhou, Yuning Chai, Benjamin Caine, et al.  Scalability in perception for autonomous driving: Waymo open dataset.  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2446–2454, 2020.
  * [30] OpenPCDet Development Team.  Openpcdet: An open-source toolbox for 3d object detection from point clouds.  https://github.com/open-mmlab/OpenPCDet, 2020.
  * [31] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin.  Attention is all you need.  In Advances in Neural Information Processing Systems (NIPS), pages 5998–6008, 2017.
  * [32] Yue Wang, Alireza Fathi, Abhijit Kundu, David Ross, Caroline Pantofaru, Tom Funkhouser, and Justin Solomon.  Pillar-based object detection for autonomous driving.  arXiv preprint arXiv:2007.10323, 2020.
  * [33] Yan Yan, Yuxing Mao, and Bo Li.  Second: Sparsely embedded convolutional detection.  Sensors, 18(10):3337, 2018.
  * [34] Bin Yang, Ming Liang, and Raquel Urtasun.  Hdnet: Exploiting hd maps for 3d object detection.  In Conference on Robot Learning, pages 146–155, 2018.
  * [35] Bin Yang, Wenjie Luo, and Raquel Urtasun.  Pixor: Real-time 3d object detection from point clouds.  In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition (CVPR), pages 7652–7660, 2018.
  * [36] Zetong Yang, Yanan Sun, Shu Liu, and Jiaya Jia.  3dssd: Point-based 3d single stage object detector.  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 11040–11048, 2020.
  * [37] Zetong Yang, Yanan Sun, Shu Liu, Xiaoyong Shen, and Jiaya Jia.  Std: Sparse-to-dense 3d object detector for point cloud.  In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 1951–1960, 2019.
  * [38] Jin Hyeok Yoo, Yecheol Kim, Ji Song Kim, and Jun Won Choi.  3d-cvf: Generating joint camera and lidar features using cross-view spatial feature fusion for 3d object detection.  arXiv preprint arXiv:2004.12636, 3, 2020.
  * [39] Wu Zheng, Weiliang Tang, Sijin Chen, Li Jiang, and Chi-Wing Fu.  Cia-ssd: Confident iou-aware single-stage object detector from point cloud.  arXiv preprint arXiv:2012.03015, 2020.
  * [40] Dingfu Zhou, Jin Fang, Xibin Song, Chenye Guan, Junbo Yin, Yuchao Dai, and Ruigang Yang.  Iou loss for 2d/3d object detection.  In 2019 International Conference on 3D Vision (3DV), pages 85–94, 2019.
  * [41] Xingyi Zhou, Jiacheng Zhuo, and Philipp Krahenbuhl.  Bottom-up object detection by grouping extreme and center points.  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 850–859, 2019.
  * [42] Yin Zhou, Pei Sun, Yu Zhang, Dragomir Anguelov, Jiyang Gao, Tom Ouyang, James Guo, Jiquan Ngiam, and Vijay Vasudevan.  End-to-end multi-view fusion for 3d object detection in lidar point clouds.  In Conference on Robot Learning, pages 923–932, 2020.
  * [43] Yin Zhou and Oncel Tuzel.  Voxelnet: End-to-end learning for point cloud based 3d object detection.  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4490–4499, 2018.
  * [44] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai.  Deformable detr: Deformable transformers for end-to-end object detection.  arXiv preprint arXiv:2010.04159, 2020.


# A generalization of the cosine addition law on semigroups

Youssef Aserrar and Elhoucien Elqorachi  Ibn Zohr University, Faculty of
sciences, Department of mathematics,
Agadir, Morocco<EMAIL_ADDRESS><EMAIL_ADDRESS>
(Date: January 1, 2004)

###### Abstract.

Our main result is that we describe the solutions $g,f:S\rightarrow\mathbb{C}$
of the functional equation

$g(x\sigma(y))=g(x)g(y)-f(x)f(y)+\alpha f(x\sigma(y)),\quad x,y\in S,$

where $S$ is a semigroup, $\alpha\in\mathbb{C}$ is a fixed constant and
$\sigma:S\rightarrow S$ an involutive automorphism.

###### Key words and phrases:

Semigroup, cosine addition law, involutive automorphism, multiplicative
function.

###### 1991 Mathematics Subject Classification:

39B52, 39B32

##  1\. Introduction

The cosine addition formula, cosine subtraction formula, and sine addition
formula on any semigroup $S$ for unknown functions
$g,f:S\rightarrow\mathbb{C}$ are, respectively, the functional equations

$g(x\sigma(y))=g(x)g(y)-f(x)f(y),$ (1.1) $g(x\sigma(y))=g(x)g(y)+f(x)f(y),$
(1.2) $g(x\sigma(y))=g(x)f(y)+f(x)g(y),$ (1.3)

for all $x,y\in S$, where $\sigma:S\rightarrow S$ is an involutive
automorphism. That is $\sigma(xy)=\sigma(x)\sigma(y)$ and
$\sigma(\sigma(x))=x$ for all $x,y\in S$. These functional equations have been
investigated by many authors. In [12] Vincze obtained the solutions of (1.2)
on abelian groups with $\sigma=id$, and it was solved on general groups by
Chung, Kannappan, and Ng [4]. The results were extended to the case of
topological groups by Poulsen and Stetkær [8] and to semigroups generated by
their squares by Ajebbar and Elqorachi [2] with $\sigma$ an involutive
automorphism. Also Stetkær [11, Theorem 6.1] gives a description of the
solution of (1.1) with $\sigma=id$ on a general semigroup in terms of the
solutions of (1.3) with $\sigma=id$. The most recent result about (1.3) with
$\sigma=id$ was obtained by Ebanks [5, Theorem 2.1] and [7, Theorem 3.1] on
semigroups. Ebanks [5, Theorem 4.1] gives the solution of (1.2) on monoids.
Recently the authors [3] solved (1.1), (1.2) and (1.3) on semigroups.

Stetkær [11, Theorem 3.1] solved the functional equation

$g(xy)=g(x)g(y)-f(x)f(y)+\alpha f(xy),\quad x,y\in S.$ (1.4)

on a semigroup $S$, where $\alpha\in\mathbb{C}$ is a fixed constant. He
expressed the solutions in terms of multiplitive functions on $S$ and
solutions $h:S\rightarrow\mathbb{C}$ of the special case of the sine addition
law

$h(xy)=h(x)\chi(y)+h(y)\chi(x),\quad x,y\in S,$ (1.5)

in which $\chi:S\rightarrow\mathbb{C}$ is a multiplicative function. Equation
(1.4) generalizes both the cosine addition formula (1.1) and the cosine
subtraction formula (1.2) with $\sigma=id$.

As a continuation and a generalization of these investigations we determine
the complex valued solutions of the functional equation

$g(x\sigma(y))=g(x)g(y)-f(x)f(y)+\alpha f(x\sigma(y)),\quad x,y\in S,$ (1.6)

on semigroups, where $\sigma:S\rightarrow S$ is an involutive automorphism. We
obtain explicit formulas for the solutions expressed in terms of
multiplicative, additive and sometimes arbitrary functions. The paper
concludes with some examples.

Our notation is decribed in the following set up.

##  2\. Set up and notation

Throughout this paper $S$ denotes a semigroup.
A function $a:S\rightarrow\mathbb{C}$ is additive if

$a(xy)=a(x)+a(y)\quad\text{for all}\ x,y\in S.$

A function $\chi:S\rightarrow\mathbb{C}$ is multiplicative if

$\chi(xy)=\chi(x)\chi(y)\quad\text{for all}\ x,y\in S.$

A function $f:S\rightarrow\mathbb{C}$ is central if $f(xy)=f(yx)$ for all
$x,y\in S$, and $f$ is abelian if $f$ is central and $f(xyz)=f(xzy)$ for all
$x,y,z\in S$.
For any subset $T\subseteq S$ we define the set $T^{2}:=\\{xy\ |\ x,y\in
T\\}$, so $T^{2}$ consists of all products of two (or more) elements of $T$.
If $\chi:S\rightarrow\mathbb{C}$ is a non-zero multiplicative function, we
define the sets

$I_{\chi}:=\\{x\in S\mid\chi(x)=0\\}$ $P_{\chi}:=\\{p\in I_{\chi}\backslash
I_{\chi}^{2}\ |up,pv,upv\in I_{\chi}\backslash I_{\chi}^{2}\ \text{for all}\
u,v\in S\backslash I_{\chi}\\}.$

For any function $f:S\rightarrow\mathbb{C}$ we define the function

$f^{*}(x)=f(\sigma(x)),x\in S.$

We call $f^{e}:=\frac{f+f^{*}}{2}$ the even part of $f$ and
$f^{\circ}:=\frac{f-f^{*}}{2}$ its odd part. The function $f$ is said to be
even if $f=f^{*}$, and $f$ is said to be odd if $f=-f^{*}$. In the following
lemma we give some properties of the set $P_{\chi}$ .

######  Lemma 2.1.

  1. (a)

If $u\in S\backslash I_{\chi}$ and $p\in P_{\chi}$, then $up,pu\in P_{\chi}$ .

  2. (b)

$\sigma(P_{\chi})=P_{\chi^{*}}$. Note in particular that
$\sigma(P_{\chi})=P_{\chi}$ , if $\chi=\chi^{*}$.

###### Proof.

(a) Follows directly from the definition of $P_{\chi}$.
(b) Easy to verify using the fact that $\sigma:S\rightarrow S$ is a bijection
(See [6, Lemma 4.1]). ∎

For a topological semigroup $S$ let $C(S)$ denote the algebra of continuous
functions from $S$ into $\mathbb{C}$.

##  3\.  The main result

The following lemmas will be used later.

######  Lemma 3.1.

Let $f,g:S\rightarrow\mathbb{C}$ be a solution of the functional equation

$f(x\sigma(y))=\beta f(x)f(y)-\beta g(x)g(y),$ (3.1)

where $g$ a non-zero function such that $g=0$ on $S^{2}$ and
$\beta\in\mathbb{C}\backslash\\{0\\}$ is a constant. Then $f$ and $g$ are
linearly dependent.

###### Proof.

If $f=0$ or $g=0$ then $f$ and $g$ are linearly dependent, so we may assume
that $f\neq 0$ and $g\neq 0$. By applying (3.1) to the pair $(xy,z)$ and
taking into account that $g=0$ on $S^{2}$ we obtain

$f(xy\sigma(z))=\beta f(xy)f(z),\ \text{for all}\ x,y,z\in S.$ (3.2)

Now if we apply (3.1) to the pair $(x,\sigma(y)z)$ and taking into account
that $g=0$ on $S^{2}$ we get

$f(xy\sigma(z))=\beta f(x)f(\sigma(y)z),\ \text{for all}\ x,y,z\in S.$ (3.3)

So we deduce from (3.2) and (3.3) since $\beta\neq 0$ that

$f(xy)f(z)=f(x)f(\sigma(y)z),\ \text{for all}\ x,y,z\in S.$

Then we get since $f\neq 0$ that $f(xy)=f(x)\phi(\sigma(y))$ for some function
$\phi:S\rightarrow\mathbb{C}$. Substituting this into (3.1) we find that

$f(x)\phi(y)=\beta f(x)f(y)-\beta g(x)g(y).$

This implies that

$\left[\beta f(y)-\phi(y)\right]f=\beta g(y)g.$

Choosing $y_{0}\in S$ such that $g(y_{0})\neq 0$ we see that $f$ and $g$ are
linearly dependent. This completes the proof of Lemma 3.1. ∎

######  Lemma 3.2.

Let $g,f:S\rightarrow\mathbb{C}$ be two functions such that

$f=a_{1}\chi_{1}+a_{2}\chi_{2}\quad\text{and}\quad
g=b_{1}\chi_{1}+b_{2}\chi_{2},$

where $\chi_{1},\chi_{2}:S\rightarrow\mathbb{C}$ are two different non-zero
multiplicative functions, $g\neq 0$ and
$a_{1},a_{2}\in\mathbb{C}\backslash\\{0\\}$, $b_{1},b_{2}\in\mathbb{C}$ are
constants. We have

  1. (1)

If $f$ is even and $g$ is odd, then $a_{1}=a_{2}$ and $b_{1}+b_{2}=0$.

  2. (2)

If $f$ is odd and $g$ is even, then $a_{1}+a_{2}=0$ and $b_{1}=b_{2}$.

###### Proof.

(1) If $f$ is even and $g$ is odd, we get that

$a_{1}\chi_{1}+a_{2}\chi_{2}=a_{1}\chi_{1}^{*}+a_{2}\chi_{2}^{*},$ (3.4)

and

$b_{1}\chi_{1}+b_{2}\chi_{2}=-b_{1}\chi_{1}^{*}-b_{2}\chi_{2}^{*}.$ (3.5)

By the help of [11, Proposition A.2] we deduce from (3.4) that
$a_{1}\chi_{1}=a_{1}\chi_{1}^{*}$ or $a_{1}\chi_{1}=a_{2}\chi_{2}^{*}$. If
$a_{1}\chi_{1}=a_{1}\chi_{1}^{*}$ then $\chi_{1}=\chi_{1}^{*}$ since
$a_{1}\neq 0$, and then we get from (3.4) that $\chi_{2}=\chi_{2}^{*}$ since
$a_{2}\neq 0$. In view of (3.5) we deduce that $g=0$. This contradicts the
fact that $g\neq 0$. So $a_{1}\chi_{1}=a_{2}\chi_{2}^{*}$ then since
$\chi_{1},\chi_{2}$ are non-zero, $a_{1}\neq 0$ and $a_{2}\neq 0$, according
to [9, Theorem 3.18 (a)] we deduce that $\chi_{1}=\chi_{2}^{*}$ and then
$a_{1}=a_{2}$. Now (3.5) becomes $(b_{1}+b_{2})(\chi_{1}+\chi_{2})=0$ which
implies that $b_{1}+b_{2}=0$. This is case (1).
(2) We proceed similarly to the case (1) to get the result. This completes the
proof of Lemma (2). ∎

In the following lemma we give some key properties of the solutions of
Equation (1.6).

######  Lemma 3.3.

Let $g,f:S\rightarrow\mathbb{C}$ be a solution of the functional equation
(1.6), and define the function $G:=g-\alpha f$. The following statements hold:

  1. (1)

$G(x\sigma(y))=G(y\sigma(x))$ for all $x,y\in S$.

  2. (2)

$G(xyz)=G^{*}(xyz)$ for all $x,y,z\in S$.

  3. (3)

For all $x,y,z\in S$

$g^{e}(x)g^{\circ}(yz)=f^{e}(x)f^{\circ}(yz),$ (3.6)
$g^{e}(yz)g^{\circ}(x)=f^{e}(yz)f^{\circ}(x).$ (3.7)

###### Proof.

(1) The functional equation (1.6) is equivalent to

$G(x\sigma(y))=g(x)g(y)-f(x)f(y)\quad\text{for all}\quad x,y\in S.$ (3.8)

The right hand side of (3.8) is invariant under the interchange of $x$ and
$y$. That is

$G(x\sigma(y))=G(y\sigma(x))\quad\text{for all}\quad x,y\in S.$ (3.9)

(2) Replacing $y$ by $\sigma(y)$ in (3.9), we get $G(xy)=G^{*}(yx)$ for all
$x,y\in S$, and then we deduce that

$G(xyz)=G^{*}(zxy)=G(yzx)=G^{*}(xyz)\quad\text{for all}\quad x,y,z\in S.$

(3) By applying the identity (3.8) to the pair $(x,\sigma(yz))$ we obtain

$G(xyz)=g(x)g^{*}(yz)-f(x)f^{*}(yz)\quad\text{for all}\quad x,y,z\in S.$
(3.10)

Then by using (2), we deduce from (3.10) that

$g(x)g^{*}(yz)-f(x)f^{*}(yz)=g^{*}(x)g(yz)-f^{*}(x)f(yz)\quad\text{for
all}\quad x,y,z\in S.$ (3.11)

Since $k=k^{e}+k^{\circ}$ and $k^{*}=k^{e}-k^{\circ}$ for any function
$k:S\rightarrow\mathbb{C}$, then we get from (3.11) after some rearrangement
that for all $x,y,z\in S$

$g^{\circ}(x)g^{e}(yz)-f^{\circ}(x)f^{e}(yz)=g^{e}(x)g^{\circ}(yz)-f^{e}(x)f^{\circ}(yz).$
(3.12)

In the identity (3.12) the left hand side is an odd function of $x$ while the
right is an even function of $x$, then

$g^{\circ}(x)g^{e}(yz)-f^{\circ}(x)f^{e}(yz)=0,$ (3.13)

and

$g^{e}(x)g^{\circ}(yz)-f^{e}(x)f^{\circ}(yz)=0,$ (3.14)

for all $x,y,z\in S$. This completes the proof of Lemma 3.3. ∎

Now we present the general solution of (1.6) on semigroups. Stetkær [11,
Theorem 3.1] is Theorem 3.4 with $\sigma=id$.

######  Theorem 3.4.

The solutions $g,f:S\rightarrow\mathbb{C}$ of the functional equation (1.6)
are the following families:

  1. (1)

$\alpha=\pm 1$, $f$ is any non-zero function and $g=\alpha f$.

  2. (2)

$\alpha\neq 1$, $f=g\neq 0$ and $g=0$ on $S^{2}$.

  3. (3)

$\alpha\neq-1$, $f=-g\neq 0$ and $g=0$ on $S^{2}$.

  4. (4)

$f=(q+\alpha)\dfrac{\chi}{2}$ and
$g=\left(1\pm\sqrt{1+q^{2}-\alpha^{2}}\right)\dfrac{\chi}{2}$, where
$q\in\mathbb{C}$ is a constant and $\chi:S\rightarrow\mathbb{C}$ a non-zero
even multiplicative function.

  5. (5)

$f=\alpha\dfrac{\chi_{1}+\chi_{2}}{2}+q\dfrac{\chi_{1}-\chi_{2}}{2}$ and
$g=\dfrac{\chi_{1}+\chi_{2}}{2}\pm\sqrt{1+q^{2}-\alpha^{2}}\dfrac{\chi_{1}-\chi_{2}}{2}$,
where $\chi_{1},\chi_{2}:S\rightarrow\mathbb{C}$ are two different non-zero
even multiplicative functions and $q\in\mathbb{C}\backslash\\{\pm\alpha\\}$ is
a constant.

  6. (6)

$\alpha\neq 0$, $f=\alpha\chi_{1}$ and $g=\chi_{2}$, where
$\chi_{1},\chi_{2}:S\rightarrow\mathbb{C}$ are two different non-zero even
multiplicative functions.

  7. (7)

$f=\alpha\chi+h$ and $g=\chi\pm h$, where $\chi:S\rightarrow\mathbb{C}$ is a
non-zero even multiplicative function and $h:S\rightarrow\mathbb{C}$ is an
even solution of the special sine addition law (1.5).

  8. (8)

$\alpha\neq\pm 1$, $f=\dfrac{1+\alpha}{2}\chi-\dfrac{1-\alpha}{2}\chi^{*}$ and
$g=\dfrac{1+\alpha}{2}\chi+\dfrac{1-\alpha}{2}\chi^{*}$, where
$\chi:S\rightarrow\mathbb{C}$ is a multiplicative function such that
$\chi\neq\chi^{*}$.
Note that, off the exceptional case (1), $g$ and $f$ are abelian.

Moreover, if $S$ is a topological semigroup, $f\in C(S)$ such that
$f\neq\alpha\chi$ for any multiplicative function $\chi\in C(S)$, then $g\in
C(S)$.

###### Proof.

It is easy to check that each of the pairs described in Theorem 3.4 is a
solution of (1.6). So assume that the pair $(g,f)$ is a solution of equation
(1.6). If $g=0$, then (1.6) can be written as

$\alpha f(x\sigma(y))=f(x)f(y),\ x,y\in S.$

If $\alpha=0$ then $f=0$. This occurs in case (4) with $q=-\alpha$. Now if
$\alpha\neq 0$, then

$f(x\sigma(y))=\dfrac{1}{\alpha}f(x)f(y),\ x,y\in S.$

Then according to [3, Lemma 4.1], $f=\alpha\chi$, where
$\chi:S\rightarrow\mathbb{C}$ is an even multiplicative function. This occurs
in case (4) with $q=\alpha$. From now on we assume that $g\neq 0$ and we
discuss two cases according to wether $g$ and $f$ are linearly dependent or
not.
First case: $g$ and $f$ are linearly dependent. There exists a constant
$c\in\mathbb{C}$ such that $f=cg$. So (1.6) becomes

$(1-\alpha c)g(x\sigma(y))=(1-c^{2})g(x)g(y),\ \text{for all}\ x,y\in S.$

Then we obtain by proceeding exactly as in the proof of [11, Lemma 4.3] and
using [3, Lemma 4.1] the cases (1), (2), (3) and (4).
Second case : $g$ and $f$ are linearly independent.
Subcase A : $g^{\circ}=0$ and $f^{\circ}=0$. That is $g$ and $f$ are even, so
if we replace $y$ by $\sigma(y)$, the functional equation (1.6) can be written
as follows

$g(xy)=g(x)g(y)-f(x)f(y)+\alpha f(xy)\quad x,y\in S.$

According to [11, Theorem 3.1] and taking into account that $f$ and $g$ are
linearly independent and $g\neq 0$ we have the following possibilities :
(i) $f=\alpha\dfrac{\chi_{1}+\chi_{2}}{2}+q\dfrac{\chi_{1}-\chi_{2}}{2}$ and
$g=\dfrac{\chi_{1}+\chi_{2}}{2}\pm\sqrt{1+q^{2}-\alpha^{2}}\dfrac{\chi_{1}-\chi_{2}}{2}$,
where $\chi_{1},\chi_{2}:S\rightarrow\mathbb{C}$ are two different non-zero
multiplicative functions and $q\in\mathbb{C}\backslash\\{\pm\alpha\\}$ is a
constant. So

$f-\alpha
g=\dfrac{q\pm\alpha\sqrt{1+q^{2}-\alpha^{2}}}{2}\left(\chi_{1}-\chi_{2}\right).$

Since $f$ and $g$ are even, we see that

$\dfrac{q\pm\alpha\sqrt{1+q^{2}-\alpha^{2}}}{2}\left(\chi_{1}-\chi_{2}\right)=\dfrac{q\pm\alpha\sqrt{1+q^{2}-\alpha^{2}}}{2}\left(\chi_{1}^{*}-\chi_{2}^{*}\right).$
(3.15)

On the other hand $g$ and $f$ are linearly independent implies that $f-\alpha
g\neq 0$, and then $\dfrac{q\pm\alpha\sqrt{1+q^{2}-\alpha^{2}}}{2}\neq 0$. So
(3.15) reduces to

$\chi_{1}-\chi_{2}=\chi_{1}^{*}-\chi_{2}^{*}.$

Then since $g$ is even, we get that

$\chi_{1}+\chi_{2}=\chi_{1}^{*}+\chi_{2}^{*}.$

So, we deduce from the last two identities that $\chi_{1}=\chi_{1}^{*}$ and
$\chi_{2}=\chi_{2}^{*}$. This occurs in case (5).
(ii) $\alpha\neq 0$, $f=\alpha\chi_{1}$ and $g=\chi_{2}$, where
$\chi_{1},\chi_{2}:S\rightarrow\mathbb{C}$ are two different non-zero
multiplicative functions. In addition since $f$ and $g$ are even, we deduce
that $\chi_{1}^{*}=\chi_{1}$ and $\chi_{2}^{*}=\chi_{2}$. This is case (6).
(iii) $f=\alpha\chi+h$ and $g=\chi\pm h$, where
$h,\chi:S\rightarrow\mathbb{C}$ is a solution of the sine addition law

$h(xy)=h(x)\chi(y)+h(y)\chi(x),\quad x,y\in S,$

such that $\chi\neq 0$ is multiplicative and $h\neq 0$. So $f-\alpha
g=(1\pm\alpha)h$, and $1\pm\alpha\neq 0$ since $f$ and $g$ are linearly
independent. Since $f$ and $g$ are even, we get that $h^{*}=h$ and then
$\chi^{*}=\chi$. This occurs in case (7).
Subcase B: $g^{\circ}=0$ and $f^{\circ}\neq 0$. In this case we deduce from
(3.6) and (3.7) respectively that $f^{e}(x)f^{\circ}(yz)=0$ and $f^{e}(yz)=0$
for all $x,y,z\in S$.
Subcase B.1: $f^{\circ}=0$ on $S^{2}$. That is $f=0$ on $S^{2}$ since
$f^{e}=0$ on $S^{2}$. The functional equation (1.6) can be written as follows

$g(x\sigma(y))=g(x)g(y)-f(x)f(y),\ \text{for all}\ x,y\in S.$

Since $f\neq 0$ ($f^{\circ}\neq 0$) we get according to Lemma 3.1 that $f$ and
$g$ are linearly dependent. This is a contradiction. This case does not occur.
Subcase B.2: $f^{\circ}\neq 0$ on $S^{2}$. This implies that $f^{e}=0$, so if
we replace $y$ by $\sigma(y)$, the functional equation (1.6) can be written as
follows :

$g(xy)=g(x)g(y)+f(x)f(y)+\alpha f(xy),\quad x,y\in S.$

This means that the pair $(g,if)$ satisfies (1.4), where $\alpha$ is replaced
by $-i\alpha$. According to [11, Theorem 3.1] and taking into account that $g$
and $f$ are linearly independent and $g\neq 0$ we have the following
possibilities:
(i) $if=-i\alpha\dfrac{\chi_{1}+\chi_{2}}{2}+q\dfrac{\chi_{1}-\chi_{2}}{2}$
and
$g=\dfrac{\chi_{1}+\chi_{2}}{2}\pm\sqrt{1+q^{2}+\alpha^{2}}\dfrac{\chi_{1}-\chi_{2}}{2}$,
where $\chi_{1},\chi_{2}:S\rightarrow\mathbb{C}$ are two different non-zero
multiplicative functions and $q\in\mathbb{C}\backslash\\{\pm i\alpha\\}$ is a
constant. So

$f=\left(\dfrac{-\alpha-
iq}{2}\right)\chi_{1}+\left(\dfrac{iq-\alpha}{2}\right)\chi_{2},$

and

$g=\left(\dfrac{1+\sqrt{1+q^{2}+\alpha^{2}}}{2}\right)\chi_{1}+\left(\dfrac{1-\sqrt{1+q^{2}+\alpha^{2}}}{2}\right)\chi_{2},$

or

$g=\left(\dfrac{1-\sqrt{1+q^{2}+\alpha^{2}}}{2}\right)\chi_{1}+\left(\dfrac{1+\sqrt{1+q^{2}+\alpha^{2}}}{2}\right)\chi_{2}.$

Since $q\neq\pm i\alpha$, we see that $\alpha\neq\pm iq$. Then since $f$ is
odd and $g$ is even we get according to Lemma (2) (2) that

$\dfrac{-\alpha-iq}{2}+\dfrac{iq-\alpha}{2}=0$

and

$\dfrac{1-\sqrt{1+q^{2}+\alpha^{2}}}{2}=\dfrac{1+\sqrt{1+q^{2}+\alpha^{2}}}{2}.$

Then $\alpha=0$ and $\sqrt{1+q^{2}+\alpha^{2}}=0$. This implies that $iq=\pm
1$, so

$f=\pm\left(\dfrac{\chi_{2}-\chi_{1}}{2}\right),$

and

$g=\pm\left(\dfrac{\chi_{2}-\chi_{1}}{2}\right).$

This contradicts the fact that $g$ and $f$ are linearly independent. This case
does not occur.
(ii) $\alpha\neq 0$, $if=-i\alpha\chi_{1}$ and $g=\chi_{2}$, where
$\chi_{1},\chi_{2}:S\rightarrow\mathbb{C}$ are two different non-zero
multiplicative functions. Then $f=-\alpha\chi_{1}$. In addition since $f$ is
odd and $g$ is even, we deduce that $\chi_{1}^{*}=-\chi_{1}$ and
$\chi_{2}^{*}=\chi_{2}$. This implies that $\chi_{1}=0$. This case does not
occur.
(iii) $if=-i\alpha\chi+h$ and $g=\chi\pm h$, where
$\chi,h:S\rightarrow\mathbb{C}$ is a solution of (1.5). Then $f=-\alpha\chi-
ih$. If $g=\chi+h$, we get that

$f+ig=(i-\alpha)\chi,$

and then since $f$ is odd and $g$ is even

$ig-f=(i-\alpha)\chi^{*}.$

By adding the last two identities we obtain
$g=(i-\alpha)\dfrac{\chi+\chi^{*}}{2i}$, and then
$f=(i-\alpha)\dfrac{\chi-\chi^{*}}{2}$. The fact the $f\neq 0$ implies that
$\chi\neq\chi^{*}$ and $\alpha\neq i$. Substituting the forms of $f$ and $g$
in (1.6) we get after reduction that

$\chi(x)\left[(1-i\alpha)\chi^{*}(y)-(1+i\alpha)\chi(y)\right]+(1+i\alpha)\chi^{*}(x)\left[\chi(y)-\chi^{*}(y)\right]=0,$

for all $x,y\in S$. Then since $\chi\neq\chi^{*}$ we deduce that
$1+i\alpha=0$. That is $\alpha=i$, so this case does not occur since
$\alpha\neq i$. For the case $g=\chi-h$ we proceed by the same way to get that
$g=(i+\alpha)\dfrac{\chi+\chi^{*}}{2i}$ and
$f=(i+\alpha)\dfrac{\chi-\chi^{*}}{2}$ with $\chi\neq\chi^{*}$ and
$\alpha\neq-i$. Similarly to the previous case we get by substitution that
$\alpha=-i$. This case does not occur.
Subcase C : $g^{\circ}\neq 0$ and $f^{\circ}=0$. We deduce from (3.6) and
(3.7) respectively that $g^{e}(x)g^{\circ}(yz)=0$ and $g^{e}(yz)=0$ for all
$x,y,z\in S$.
Subcase C.1 : $g^{\circ}=0$ on $S^{2}$. Then $g=0$ on $S^{2}$ since $g^{e}=0$
on $S^{2}$, so the functional equation (1.6) becomes

$0=g(x)g(y)-f(x)f(y)+\alpha f(x\sigma(y)),\quad x,y\in S.$

That is

$\alpha f(x\sigma(y))=f(x)f(y)-g(x)g(y),\quad x,y\in S.$

Since $f$ and $g$ are linearly independent, we see that $\alpha\neq 0$, so for
all $x,y\in S$

$f(x\sigma(y))=\dfrac{1}{\alpha}f(x)f(y)-\dfrac{1}{\alpha}g(x)g(y).$

Since $g\neq 0$ ($g^{\circ}\neq 0$) we get according to Lemma 3.1 that $f$ and
$g$ are linearly dependent. This is a contradiction. This case does not occur.
Subcase C.2 : $g^{\circ}\neq 0$ on $S^{2}$. In this case we get that
$g^{e}=0$, so if we replace $y$ by $\sigma(y)$ the functional equation (1.6)
can be written as follows

$g(xy)=-g(x)g(y)-f(x)f(y)+\alpha f(xy),\quad x,y\in S.$

This means that the pair $(-g,if)$ satisfies the functional equation (1.4),
where $\alpha$ is replaced by $i\alpha$. According to [11, Theorem 3.1] and
taking into account that $g$ and $f$ are linearly independent we have the
following cases
(i) $if=i\alpha\dfrac{\chi_{1}+\chi_{2}}{2}+q\dfrac{\chi_{1}-\chi_{2}}{2}$ and
$-g=\dfrac{\chi_{1}+\chi_{2}}{2}\pm\sqrt{1+q^{2}+\alpha^{2}}\dfrac{\chi_{1}-\chi_{2}}{2}$,
where $\chi_{1},\chi_{2}:S\rightarrow\mathbb{C}$ are two different non-zero
multiplicative functions and $q\in\mathbb{C}\backslash\\{\pm i\alpha\\}$ is a
constant. Then

$f=\left(\dfrac{\alpha-
iq}{2}\right)\chi_{1}+\left(\dfrac{\alpha+iq}{2}\right)\chi_{2},$

and

$g=\left(\dfrac{-1-\sqrt{1+q^{2}+\alpha^{2}}}{2}\right)\chi_{1}+\left(\dfrac{-1+\sqrt{1+q^{2}+\alpha^{2}}}{2}\right)\chi_{2},$

or

$g=\left(\dfrac{-1+\sqrt{1+q^{2}+\alpha^{2}}}{2}\right)\chi_{1}+\left(\dfrac{-1-\sqrt{1+q^{2}+\alpha^{2}}}{2}\right)\chi_{2}.$

Since $q\neq\pm i\alpha$, we see that $\alpha\neq\pm iq$. Then since $f$ is
even and $g$ is odd we get according to Lemma (2) (1) that

$\left\\{\begin{array}[]{l}\dfrac{\alpha-iq}{2}=\dfrac{\alpha+iq}{2}\\\
\dfrac{-1+\sqrt{1+q^{2}+\alpha^{2}}}{2}+\dfrac{-1-\sqrt{1+q^{2}+\alpha^{2}}}{2}=0\\\
\end{array}.\right.$

This case does not occur.
(ii) $\alpha\neq 0$, $if=i\alpha\chi_{1}$ and $-g=\chi_{2}$, where
$\chi_{1},\chi_{2}:S\rightarrow\mathbb{C}$ are two different non-zero
multiplicative functions. Then $f=\alpha\chi_{1}$ and $g=-\chi_{2}$. In
addition since $g$ is odd and $f$ is even, we deduce that
$\chi_{1}^{*}=\chi_{1}$ and $\chi_{2}^{*}=-\chi_{2}$. This means that
$\chi_{2}=0$. This case does not occur.
(iii) $if=i\alpha\chi+h$ and $-g=\chi\pm h$, where
$\chi,h:S\rightarrow\mathbb{C}$ is a solution of (1.5). So $f=\alpha\chi-ih$
and $g=-\chi\pm h$. Suppose that $g=-\chi-h$, we get that

$f-ig=(\alpha+i)\chi,$

then since $f$ is even and $g$ is odd we deduce that

$f+ig=(\alpha+i)\chi^{*}.$

By adding the last two identities, we get that

$f=\dfrac{\alpha+i}{2}\left[\chi+\chi^{*}\right],$

and then

$g=\dfrac{\alpha+i}{2i}\left[\chi^{*}-\chi\right].$

The fact that $g\neq 0$ implies that $\chi\neq\chi^{*}$ and $\alpha\neq-i$. So
by substituting the forms of $g$ and $f$ in (1.6) we get that for all $x,y\in
S$

$\chi(x)\left[(i\alpha-1)\chi(y)-(i\alpha+1)\chi^{*}(y)\right]+\chi^{*}(x)(1-i\alpha)\left[\chi(y)-\chi^{*}(y)\right]=0.$

Then since $\chi\neq\chi^{*}$, we deduce that $1-i\alpha=0$. That is
$\alpha=-i$. This contradict the fact that $\alpha\neq-i$, so this case does
not occur. Now if $g=-\chi+h$, we get by the same way that
$f=\dfrac{\alpha-i}{2}\left[\chi+\chi^{*}\right]$ and
$g=\dfrac{\alpha-i}{2i}\left[\chi-\chi^{*}\right]$, where $\chi\neq\chi^{*}$
and $\alpha\neq i$, and then by substitution that $\alpha=i$. This case does
not occur.
Subcase D : $g^{\circ}\neq 0$ and $f^{\circ}\neq 0$.
Subcase D.1 : $g^{\circ}=0$ on $S^{2}$ and $f^{\circ}=0$ on $S^{2}$. That is
$g=g^{e}$ on $S^{2}$ and $f=f^{e}$ on $S^{2}$, and from (3.7) we deduce that
$f^{e}=cg^{e}$ on $S^{2}$ for some constant $c\in\mathbb{C}$. That is $f=cg$
on $S^{2}$, so the functional equation (1.6) can be written as follows

$(1-c\alpha)g(x\sigma(y))=g(x)g(y)-f(x)f(y).$

Since $g$ and $f$ are linearly independent, we see that $\beta:=1-c\alpha\neq
0$. Then

$g(x\sigma(y))=\dfrac{1}{\beta}g(x)g(y)-\dfrac{1}{\beta}f(x)f(y).$

This means that the pair $\left(\dfrac{1}{\beta}g,\dfrac{i}{\beta}f\right)$
satisfies the functional equation (1.2), so taking into account that $g$ and
$f$ are linearly independent we get from [3, Theorem 4.2 ((4) and (5))] that
$\dfrac{1}{\beta}g$ and $\dfrac{i}{\beta}f$ are even. This is a contradiction
since $g^{\circ}\neq 0$ and $f^{\circ}\neq 0$. This case does not occur.
Subcase D.2 : $g^{\circ}=0$ on $S^{2}$ and $f^{\circ}\neq 0$ on $S^{2}$. We
get from (3.6) that $f^{e}=0$, then from (3.7) that $g^{e}=0$ on $S^{2}$. That
is $g=0$ on $S^{2}$. The functional equation (1.6) becomes

$\alpha f(x\sigma(y))=f(x)f(y)-g(x)g(y).$

Since $g$ and $f$ are linearly independent, we see that $\alpha\neq 0$, so

$f(x\sigma(y))=\dfrac{1}{\alpha}f(x)f(y)-\dfrac{1}{\alpha}g(x)g(y).$

Since $g\neq 0$ ($g^{\circ}\neq 0$) we get according to Lemma 3.1 that $f$ and
$g$ are linearly dependent. This is a contradiction. This case does not occur.
Subcase D.3 : $g^{\circ}\neq 0$ on $S^{2}$ and $f^{\circ}=0$ on $S^{2}$. We
deduce from (3.6) that $g^{e}=0$, and then by using (3.7) we get that
$f^{e}=0$ on $S^{2}$. This implies that $f=0$ on $S^{2}$, and (1.6) can be
written as follows

$g(x\sigma(y))=g(x)g(y)-f(x)f(y).$

Since $f\neq 0$($f^{\circ}\neq 0$) we get according to Lemma 3.1 that $f$ and
$g$ are linearly dependent. This case does not occur.
Subcase D.4 : $g^{\circ}\neq 0$ on $S^{2}$ and $f^{\circ}\neq 0$ on $S^{2}$.
By using (3.6) we get that

$g^{e}=\delta f^{e},$ (3.16)

for some constant $\delta\in\mathbb{C}$.
Subcase D.4.1 : $f^{e}=0$. So $g^{e}=0$, and then if we replace $y$ by
$\sigma(y)$ the functional equation (1.6) becomes

$g(xy)=-g(x)g(y)+f(x)f(y)+\alpha f(xy).$

This means that the pair $\left(-g,f\right)$ satisfies (1.4), where $\alpha$
is replaced by $-\alpha$. According to [11, Theorem 3.1] and taking into
account that $g$ and $f$ are linearly independent we have the following cases
(i) $f=-\alpha\dfrac{\chi_{1}+\chi_{2}}{2}+q\dfrac{\chi_{1}-\chi_{2}}{2}$ and
$-g=\dfrac{\chi_{1}+\chi_{2}}{2}\pm\sqrt{1+q^{2}-\alpha^{2}}\dfrac{\chi_{1}-\chi_{2}}{2}$,
where $\chi_{1},\chi_{2}:S\rightarrow\mathbb{C}$ are two different non-zero
multiplicative functions and $q\in\mathbb{C}\backslash\\{\pm\alpha\\}$ is a
constant. Then
$g=-\dfrac{\chi_{1}+\chi_{2}}{2}\pm\sqrt{1+q^{2}-\alpha^{2}}\dfrac{\chi_{1}-\chi_{2}}{2}$.
So $f-\alpha
g=\dfrac{q\pm\alpha\sqrt{1+q^{2}-\alpha^{2}}}{2}\left(\chi_{1}-\chi_{2}\right)$,
and $\dfrac{q\pm\alpha\sqrt{1+q^{2}-\alpha^{2}}}{2}\neq 0$ since $g$ and $f$
are linearly independent. The fact that $f$ and $g$ are odd implies that

$\dfrac{q\pm\alpha\sqrt{1+q^{2}-\alpha^{2}}}{2}(\chi_{1}-\chi_{2})=\dfrac{q\pm\alpha\sqrt{1+q^{2}-\alpha^{2}}}{2}(\chi_{2}^{*}-\chi_{1}^{*}).$

This implies that

$\chi_{1}-\chi_{2}=\chi_{2}^{*}-\chi_{1}^{*}.$

Then, since $g$ is odd we get that

$\chi_{1}+\chi_{2}=-(\chi_{1}^{*}+\chi_{2}^{*}).$

So we deduce from the last two identities that $\chi_{1}=-\chi_{1}^{*}$ and
$\chi_{2}=-\chi_{2}^{*}$. This implies that $\chi_{1}=\chi_{2}=0$. This case
does not occur.
(ii) $\alpha\neq 0$, $f=-\alpha\chi_{1}$ and $-g=\chi_{2}$, where
$\chi_{1},\chi_{2}:S\rightarrow\mathbb{C}$ are two different non-zero
multiplicative functions. Then $g=-\chi_{2}$. In addition since $g$ and $f$
are odd, we deduce that $\chi_{1}^{*}=-\chi_{1}$ and $\chi_{2}^{*}=-\chi_{2}$.
That is $\chi_{1}=\chi_{2}=0$. This case does not occur.
(iii) $f=-\alpha\chi+h$ and $-g=\chi\pm h$, where
$\chi,h:S\rightarrow\mathbb{C}$ is a solution of (1.5). So $g=-\chi\pm h$.
Then $f-\alpha g=(1\pm\alpha)h$ and $1\pm\alpha\neq 0$ since $g$ and $f$ are
linearly independent. Since $g$ and $f$ are odd, we see that $h=-h^{*}$, and
then $\chi=-\chi^{*}$. This implies that $\chi=0$. This case does not occur.
Subcase D.4.2 : $f^{e}\neq 0$. We get from (3.6) that $f^{\circ}=bg^{\circ}$
on $S^{2}$ for some constant $b\in\mathbb{C}$ and $\delta\neq 0$.
Subcase D.4.2.1 : $f^{e}=0$ on $S^{2}$. So $g^{e}=0$ on $S^{2}$. That is
$f=bg$ on $S^{2}$ since $f^{e}=g^{e}=0$ on $S^{2}$. The functional equation
(1.6) can be written as

$(1-b\alpha)g(x\sigma(y))=g(x)g(y)-f(x)f(y).$

The fact that $g$ and $f$ are linearly independent implies that
$\gamma:=1-b\alpha\neq 0$, so we get

$g(x\sigma(y))=\dfrac{1}{\gamma}g(x)g(y)-\dfrac{1}{\gamma}f(x)f(y).$

This means that the pair $\left(\dfrac{1}{\gamma}g,\dfrac{i}{\gamma}f\right)$
satisfies (1.2), then since $f$ and $g$ are linearly independent we get from
[3, Theorem 4.2 ((4) and (5))] that $\dfrac{1}{\gamma}g$ and
$\dfrac{i}{\gamma}f$ are even. This contradicts the fact that $g^{\circ}\neq
0$ and $f^{\circ}\neq 0$. This case does not occur.
Subcase D.4.2.2 : $f^{e}\neq 0$ on $S^{2}$. In this case we get from (3.7)
that $f^{\circ}=ag^{\circ}$ for some constant $a\in\mathbb{C}$, and $a\neq 0$
since $f^{\circ}\neq 0$. So

$g^{\circ}=\dfrac{1}{a}f^{\circ}.$

So with (3.16), equation (3.6) becomes

$\dfrac{\delta}{a}f^{e}(x)f^{\circ}(yz)=f^{e}(x)f^{\circ}(yz),$

for all $x,y,z\in S$. This implies that $\dfrac{\delta}{a}=1$, and then
$\delta=a$, so we get that

$g^{\circ}=\dfrac{1}{\delta}f^{\circ}.$ (3.17)

By adding (3.17) to (3.16) we get that

$g=\delta f^{e}+\dfrac{1}{\delta}f^{\circ}.$ (3.18)

Since $f$ and $g$ are linearly independent, we see from (3.18) that
$\delta\neq\pm 1$. So in view of (3.18) the functional equation (1.6) becomes

$(\delta-\alpha)f^{e}(x\sigma(y))+\left(\dfrac{1}{\delta}-\alpha\right)f^{\circ}(x\sigma(y))=g(x)g(y)-f(x)f(y).$
(3.19)

If we apply (3.19) first to the pair $(x,\sigma(y))$ and then to the pair
$(\sigma(x),y)$ we get respectively the two following identities

$(\delta-\alpha)f^{e}(xy)+\left(\dfrac{1}{\delta}-\alpha\right)f^{\circ}(xy)=g(x)g^{*}(y)-f(x)f^{*}(y).$
(3.20)
$(\delta-\alpha)f^{e}(xy)-\left(\dfrac{1}{\delta}-\alpha\right)f^{\circ}(xy)=g^{*}(x)g(y)-f^{*}(x)f(y).$
(3.21)

By adding (3.20) to (3.21) and taking into account that
$k^{*}=k^{e}-k^{\circ}$ and $k=k^{e}+k^{\circ}$ for any function
$k:S\rightarrow\mathbb{C}$ we get

$(\delta-\alpha)f^{e}(xy)=g^{e}(x)g^{e}(y)-g^{\circ}(x)g^{\circ}(y)-f^{e}(x)f^{e}(y)+f^{\circ}(x)f^{\circ}(y).$
(3.22)

Now by using (3.16) and (3.17), the identitiy (3.22) becomes

$(\delta-\alpha)f^{e}(xy)=(\delta^{2}-1)f^{e}(x)f^{e}(y)+\left(1-\dfrac{1}{\delta^{2}}\right)f^{\circ}(x)f^{\circ}(y).$
(3.23)

Since $\delta\neq\pm 1$ and $f^{e}\neq 0$ on $S^{2}$, we see from (3.23) that
$\alpha\neq\delta$, and if we apply (3.23) to the pair $(\sigma(y),x)$ we get

$(\delta-\alpha)f^{e}(\sigma(y)x)=(\delta^{2}-1)f^{e}(x)f^{e}(y)-\left(1-\dfrac{1}{\delta^{2}}\right)f^{\circ}(x)f^{\circ}(y).$
(3.24)

By adding (3.24) to (3.23) we get since $\alpha\neq\delta$

$f^{e}(xy)+f^{e}(\sigma(y)x)=\dfrac{2(\delta^{2}-1)}{\delta-\alpha}f^{e}(x)f^{e}(y).$
(3.25)

According to [10, Theorem 2.1] we deduce from (3.25) that

$f^{e}=\dfrac{\delta-\alpha}{2(\delta^{2}-1)}\left(\chi+\chi^{*}\right),$
(3.26)

where $\chi:S\rightarrow\mathbb{C}$ is non-zero multiplicative since
$f^{e}\neq 0$. Substituting (3.26) in (3.23) and taking into account that
$f^{\circ}\neq 0$ we obtain

$f^{\circ}=\dfrac{\delta(\delta-\alpha)}{2(\delta^{2}-1)}\left(\chi-\chi^{*}\right),$
(3.27)

where $\chi\neq\chi^{*}$, so we deduce from (3.26) and (3.27) that

$f=\dfrac{\delta-\alpha}{2(\delta^{2}-1)}\left(\chi+\chi^{*}\right)+\dfrac{\delta(\delta-\alpha)}{2(\delta^{2}-1)}\left(\chi-\chi^{*}\right),$
(3.28)

and then by using (3.16) and (3.17) that

$g=\dfrac{\delta(\delta-\alpha)}{2(\delta^{2}-1)}\left(\chi+\chi^{*}\right)+\dfrac{\delta-\alpha}{2(\delta^{2}-1)}\left(\chi-\chi^{*}\right).$
(3.29)

By substituting (3.28) and (3.29) in (1.6) we deduce after reduction that
$\delta\alpha=1$. That is $\delta=\dfrac{1}{\alpha}$, and then we get that

$f=\dfrac{1+\alpha}{2}\chi-\dfrac{1-\alpha}{2}\chi^{*}\ \ \text{and}\ \
g=\dfrac{1+\alpha}{2}\chi+\dfrac{1-\alpha}{2}\chi^{*},$

where $\alpha\neq\pm 1$. This occurs in case (8).

Finally, if $S$ is a topological semigroup, the continuity statements follows
directly from [11, Proposition 5.1]. This completes the proof of Theorem 3.4.
∎

All of the following follows directly from Theorem 3.4 and [7, Theorem 3.1
(B)].

######  Corollary 3.5.

The solutions $g,f:S\rightarrow\mathbb{C}$ of the functional equation (1.6)
are the following families:

  1. (1)

$\alpha=\pm 1$, $f$ is any non-zero function and $g=\alpha f$.

  2. (2)

$\alpha\neq 1$, $f=g\neq 0$ and $g=0$ on $S^{2}$.

  3. (3)

$\alpha\neq-1$, $f=-g\neq 0$ and $g=0$ on $S^{2}$.

  4. (4)

$f=(q+\alpha)\dfrac{\chi}{2}$ and
$g=\left(1\pm\sqrt{1+q^{2}-\alpha^{2}}\right)\dfrac{\chi}{2}$, where
$q\in\mathbb{C}$ is a constant and $\chi:S\rightarrow\mathbb{C}$ a non-zero
even multiplicative function.

  5. (5)

$f=\alpha\dfrac{\chi_{1}+\chi_{2}}{2}+q\dfrac{\chi_{1}-\chi_{2}}{2}$ and
$g=\dfrac{\chi_{1}+\chi_{2}}{2}\pm\sqrt{1+q^{2}-\alpha^{2}}\dfrac{\chi_{1}-\chi_{2}}{2}$,
where $\chi_{1},\chi_{2}:S\rightarrow\mathbb{C}$ are two different non-zero
even multiplicative functions and $q\in\mathbb{C}\backslash\\{\pm\alpha\\}$ is
a constant.

  6. (6)

$\alpha\neq 0$, $f=\alpha\chi_{1}$ and $g=\chi_{2}$, where
$\chi_{1},\chi_{2}:S\rightarrow\mathbb{C}$ are two different non-zero even
multiplicative functions.

  7. (7)

$f=\alpha\chi+h$ and $g=\chi\pm h$ such that

$h=\left\\{\begin{matrix}\chi A&on&S\backslash{{I}_{\chi}}\\\
0&on&{{I}_{\chi}}\backslash{{P}_{\chi}}\\\ \rho&on&{{P}_{\chi}}\\\
\end{matrix}\ ,\right.$

where $\chi:S\rightarrow\mathbb{C}$ is an even non-zero multiplicative
function, $A:S\backslash I_{\chi}\rightarrow\mathbb{C}$ an additive function
such that $A\circ\sigma=A$, and $\rho:P_{\chi}\rightarrow\mathbb{C}$ a
function such that $\rho\circ\sigma=\rho$. In addition we have the following
conditions.
(I): If $x\in\\{up,pv,upv\\}$ for $p\in P_{\chi}$ and $u,v\in S\backslash
I_{\chi}$, then we have respectively $\rho(x)=\rho(p)\chi(u)$,
$\rho(x)=\rho(p)\chi(v)$, or $\rho(x)=\rho(p)\chi(uv)$.
(II): $h(xy)=h(yx)=0$ for all $x\in I_{\chi}\backslash P_{\chi}$ and $y\in
S\backslash I_{\chi}$.

  8. (8)

$\alpha\neq\pm 1$, $f=\dfrac{1+\alpha}{2}\chi-\dfrac{1-\alpha}{2}\chi^{*}$ and
$g=\dfrac{1+\alpha}{2}\chi+\dfrac{1-\alpha}{2}\chi^{*}$, where
$\chi:S\rightarrow\mathbb{C}$ is a multiplicative function such that
$\chi\neq\chi^{*}$.
Note that, off the exceptional case (1), $g$ and $f$ are abelian.

Furthermore, if $S$ is a topological semigroup, $f\in C(S)$ such that
$f\neq\alpha\chi$ for any multiplicative function $\chi\in C(S)$, then $g\in
C(S)$.

##  4\. Examples

In this section we give some examples of solutions of the functional equation
(1.6).

######  Example 4.1.

Let $S=(\mathbb{R},+)$ under the usual topology, and let
$\sigma:\mathbb{R}\rightarrow\mathbb{R}$ be the involution defined by
$\sigma(x)=-x$ for all $x\in\mathbb{R}$. The functional equation (1.6) can be
written as

$g(x-y)=g(x)g(y)-f(x)f(y)+\alpha f(x-y),$ (4.1)

where $f,g:\mathbb{R}\rightarrow\mathbb{C}$. We determine the continuous
solutions of (4.1) with $\alpha\neq 0$. The case $\alpha=0$ is [9, Example
4.18] where the function $f$ is replaced by $if$. The continuous non-zero
multiplicative functions on $S$ are the functions

$\chi(x)=e^{i\lambda x},\quad x\in\mathbb{R},$

where $\lambda\in\mathbb{C}$. In addition if $\chi$ is even then $\lambda=0$.
The continuous additive functions on $S$ are of the form $a(x)=\delta x$ for
all $x\in\mathbb{R}$ and some constant $\delta\in\mathbb{C}$. Such functions
are even if and only if $\delta=0$. The solutions $f,g\in C(S)$ of (4.1) are
the following:

  1. (a)

$f=g=0$.

  2. (b)

$\alpha=\pm 1$, $f$ is any non-zero continuous function on $S$ and $g=\alpha
f$.

  3. (c)

$f=\dfrac{q+\alpha}{2}$ and $g=\dfrac{1\pm\sqrt{1+q^{2}-\alpha^{2}}}{2}$,
where $q\in\mathbb{C}$ is a constant.

  4. (d)

$f(x)=\alpha\cos(\lambda x)+i\sin(\lambda x)$ and $g(x)=\cos(\lambda
x)+i\alpha\sin(\lambda x)$, where $\lambda\in\mathbb{C}\backslash\\{0\\}$.

######  Example 4.2.

Let $S=H_{3}$ be the Heisenberg group defined by

$H_{3}=\left\\{\left(\begin{matrix}1&x&z\\\ 0&1&y\\\ 0&0&1\\\
\end{matrix}\right)\mid\quad x,y,z\in\mathbb{R}\right\\},$

and let

$X=\left(\begin{matrix}1&x&z\\\ 0&1&y\\\ 0&0&1\\\ \end{matrix}\right),$

for all $x,y,z\in\mathbb{R}$. We consider the following involution

$\sigma\left(X\right)=\left(\begin{matrix}1&-x&z\\\ 0&1&-y\\\ 0&0&1\\\
\end{matrix}\right).$

According to [9, Example 2.11, Example 3.14], the continuous additive and the
non-zero multiplicative functions on $S$ have respectively the forms

$A\left(X\right)=\alpha x+\beta y,$

and

$\chi\left(X\right)=e^{ax+by},$

where $\alpha,\beta,a,b\in\mathbb{C}$. So $A\circ\sigma=A$ if and only $A=0$.
On the other hand $\chi^{*}=\chi$ implies that $\chi=1$. So the continuous
solutions of equation (1.6) are the following four type:

  1. (1)

$f=g=0$.

  2. (2)

$\alpha=\pm 1$, $f$ is any non-zero continuous function on $S$ and $g=\alpha
f$.

  3. (3)

$f(X)=\dfrac{q+\alpha}{2}$ and
$g(X)=\dfrac{1\pm\sqrt{1+q^{2}-\alpha^{2}}}{2}$, where $q\in\mathbb{C}$.

  4. (4)

$\alpha\neq\pm 1$, and

$\left\\{\begin{matrix}f(X)=\dfrac{1+\alpha}{2}e^{ax+by}-\dfrac{1-\alpha}{2}e^{-ax-
by}\\\ g(X)=\dfrac{1+\alpha}{2}e^{ax+by}+\dfrac{1-\alpha}{2}e^{-ax-by}\\\
\end{matrix}\quad,\right.$

where $a,b\in\mathbb{C}$ are constants such that $(a,b)\neq(0,0)$.

In the following example we shall apply our theory to a semigroup $S$ such
that $S^{2}\neq S$.

######  Example 4.3.

Let $S=(\mathbb{N}\backslash\\{1\\},.)$, and let $\chi:S\rightarrow\mathbb{C}$
be the multiplicative function defined by

$\chi(x):=\left\\{\begin{matrix}1&for&x\in\mathbb{N}\backslash\left(2\mathbb{N}\cup\\{1\\}\right)\\\
0&for&x\in 2\mathbb{N}\\\ \end{matrix}.\right.$

Then $I_{\chi}=2\mathbb{N}$ and $P_{\chi}=2\mathbb{N}\backslash 4\mathbb{N}$.
We let $\sigma:=id$ be the identity function. So $\chi$ is even with respect
to $\sigma$. An additive function
$A:\mathbb{N}\backslash\left(2\mathbb{N}\cup\\{1\\}\right)\rightarrow\mathbb{C}$
is defined by

$A(x):=\text{the number of times 5 occurs in the prime factorization of x}.$

By Corollary 3.5 (7), the form of the function
$h:\mathbb{N}\backslash\\{1\\}\rightarrow\mathbb{C}$ is

$h(x):=\left\\{\begin{matrix}A(x)&for&x\in\mathbb{N}\backslash\left(2\mathbb{N}\cup\left\\{1\right\\}\right)\\\
0&for&x\in 4\mathbb{N}\\\ \rho&for&x\in 2\mathbb{N}\backslash 4\mathbb{N}\\\
\end{matrix},\right.$

where $\rho:2\mathbb{N}\backslash 4\mathbb{N}\rightarrow\mathbb{C}$ is a
function satisfying the condition (I). So

$h(2(2n+1))=\rho(2)\chi(2n+1)=\rho(2)\quad\text{for all}\ n\in\mathbb{N}.$

This implies that $\rho(x)=c$ for all $x\in 2\mathbb{N}\backslash
4\mathbb{N}$, where $c:=\rho(2)\in\mathbb{C}$. That is

$h(x)=\left\\{\begin{matrix}A(x)&for&x\in\mathbb{N}\backslash\left(2\mathbb{N}\cup\left\\{1\right\\}\right)\\\
0&for&x\in 4\mathbb{N}\\\ c&for&x\in 2\mathbb{N}\backslash 4\mathbb{N}\\\
\end{matrix}.\right.$

So the condition (II) is satisfied. We get the solutions
$f,g:S\rightarrow\mathbb{C}$ of equation (1.6) by plugging the appropriate
forms above into the formulas of Corollary 3.5.

For the semigroup $S$ we have that $S^{2}=S\backslash\mathbb{P}$, where
$\mathbb{P}$ denote the set of all prime numbers, and also $S$ is neither
monoid nor generated by its squares, so we can see that we can not avoid the
cases (2), (3) and (7) from Corollary 3.5.

### Declarations

Author contributions This work is done by the authors solely.

Funding None.

Availability of data and materials Not applicable.

Code Availability Not Applicable.

Conflict of interest None.

## References

  * [1] Aczél, J., Dhombres, J., Functional equations in several variables with applications to mathematics, Information theory and to the natural and social sciences. Encyclopedie of Mathematics and its Applications, vol. 31, Cambridge University Press, Cambridge (34B40) MR1004465 (90h: 39001) (1989).
  * [2] Ajebbar, O., Elqorachi, E., Solutions and stability of trigonometric functional equations on an amenable group with an involutive automorphism. Commun Korean Math, 34(1), 55–82 (2019). https://doi.org/10.4134/CKMS.C170487
  * [3] Aserrar, Y., Elqorachi, E., Five trigonometric addition laws on semigroups. https://doi.org/10.48550/arXiv.2210.06181
  * [4] Chung, J.K, Kannappan, Pl., Ng, C.T., A generalization of the Cosine-Sine functional equation on groups. Linear Algebra Appl, 66, 259–277 (1985).
  * [5] Ebanks, B., The cosine and sine addition and subtraction formulas on semigroups. Acta Math. Hungar. no. 2, 165, 337–354 (2021).
  * [6] Ebanks, B., The sine addition and subtraction formulas on semigroups. Acta Math. Hungar, 164(2) 533–555 (2021).
  * [7] Ebanks, B., Around the sine addition law and d’Alembert’s equation on semigroups. Results Math, 77, 11 (2022). https://doi.org/10.1007/s00025-021-01548-6
  * [8] Poulsen, T.A., Stetkær, H., On the trigonometric subtraction and addition formulas. Aequat Math. 59(1-2), 84-92 (2000).
  * [9] Stetkær, H., Functional equations on groups. World scientific Publishing CO, Singapore (2013).
  * [10] Stetkær, H., A variant of d’Alembert’s functional equation. Aequat Math, no 3, 89, 657–662 (2015).
  * [11] Stetkær, H., The cosine addition law with an additional term. Aequat Math., no. 6, 90, 1147-1168 (2016).
  * [12] Vincze, E., Eine allgemeinere Methode in der Theorie der Funktionalgleichungen II. Publ. Math. Debrecen, 9, 314-323 (1962).