# TransMatting: Tri-token Equipped Transformer Model for Image Matting

Huanqia Cai, Fanglei Xue, Lele Xu, and Lili Guo  Huanqia Cai and Fanglei Xue
are with the University of Chinese Academy of Sciences, Beijing, China.
E-mail: {caihuanqia19<EMAIL_ADDRESS>Huanqia Cai, Fanglei
Xue, Lele Xu and Lili Guo are with the Key Laboratory of Space Utilization,
Technology and Engineering Center for Space Utilization, Chinese Academy of
Sciences, Beijing, China. Email: {xulele<EMAIL_ADDRESS>Huanqia Cai and
Fanglei Xue contribute equally to this paper. Corresponding author: Lele Xu.
This work was supported by the National Natural Science Foundation of China
under Grant 61901454. Project page: https://github.com/AceCHQ/TransMatting.

###### Abstract

Image matting aims to predict alpha values of elaborate uncertainty areas of
natural images, like hairs, smoke, and spider web. However, existing methods
perform poorly when faced with highly transparent foreground objects due to
the large area of uncertainty to predict and the small receptive field of
convolutional networks. To address this issue, we propose a Transformer-based
network (TransMatting) to model transparent objects with long-range features
and collect a high-resolution matting dataset of transparent objects
(Transparent-460) for performance evaluation. Specifically, to utilize
semantic information in the trimap flexibly and effectively, we also redesign
the trimap as three learnable tokens, named tri-token. Both Transformer and
convolution matting models could benefit from our proposed tri-token design.
By replacing the traditional trimap concatenation strategy with our tri-token,
existing matting methods could achieve about 10% improvement in SAD and 20% in
MSE. Equipped with the new tri-token design, our proposed TransMatting
outperforms current state-of-the-art methods on several popular matting
benchmarks and our newly collected Transparent-460.

###### Index Terms:

Tri-token, Vision Transformer, Image Matting, Deep Learning

##  1 Introduction

Image matting is a technique to separate the foreground object from the
background in an image by predicting a precise alpha matte. It has been widely
used in many applications, such as image and video editing, background
replacement, and virtual reality [1, 2, 3]. Image matting assumes that every
pixel in the image $I$ is a linear combination of the foreground object $F$
and the background $B$ by an alpha matte $\alpha$:

$I=\alpha F+(1-\alpha)B,\alpha\in[0,1]$ (1)

As only the image $I$ is known in this equation, image matting is an ill-posed
problem. So many existing methods [1, 3, 4, 5, 2, 6, 7] take a trimap as an
auxiliary input. The trimap is a single-channel image with three unique
values: 255, 0, and 128. These values segment the original image into three
parts: known foreground, known background and unknown areas.

Most traditional methods, including sampling-based [8, 9, 5, 10, 11, 12] and
propagation-based methods [1, 13, 4, 3], utilize the known area samples to
find candidate colors or propagate the known alpha value. They heavily rely on
information from known areas, especially the known foreground areas. Recently,
learning-based methods greatly improve image matting performance, but they
still need specific information from known areas to predict unknown areas [14,
7]. However, according to [14], more than 50% pixels in the unknown areas
cannot be correlated to pixels in the known regions due to the limited
reception field of deep learning methods. Furthermore, some highly transparent
objects (e.g., glass, bonfires, plastic bags, etc.) and even non-salient
objects (e.g., web, smoke, water drops, etc.) have meticulous interiors with
most pixels belonging to the unknown regions [15]. It is very challenging for
existing models to learn long-range features with little known information.
Tab. I illustrates the performance of some state-of-the-art (SOTA) methods on
transparent totally (TT) and transparent partially (TP) objects separately on
the Composition-1k test set. We could observe that the results of TT are much
worse than TP, indicating that TT objects are the key to improving the overall
evaluation performance.

To address this issue, we make the first attempt to introduce Vision
Transformer (ViT) [16] to extract features with a large receptive field. The
Transformer model is first proposed in natural language processing (NLP) and
has achieved great performance in computer vision tasks, such as
classification[16, 17, 18], segmentation [19, 20], and detection [21, 22]. It
mainly consists of multi-head self-attention (MHSA) and multi-layer perception
modules. Different from the convolution, the MHSA module could mine
information in a global scope. Thus, the ViT model could learn global semantic
features of the foreground object with high-level position relevance. To
further help the model integrate the low-level appearance features (e.g.,
texture) with high-level semantic features (e.g., shape), a Multi-scale
Global-guided Fusion (MGF) module is proposed. The MGF takes three adjacent
scales of features as input, uses the non-background mask to guide the low-
level feature, and employs the high-level feature to guide the information
integration. With this new MGF module, only foreground features could be
transmitted to the decoder, reducing the influence of background noises.

On the other hand, most current trimap-based methods follow DIM [2] to treat
the trimap as an image and concatenate it with the RGB image before feeding
into the deep model. This brings the same weakness: insufficient long-range
relationships extracted from the trimap. Meanwhile, compared with the RGB
image, the information in trimap is very sparse and has some high-level
positional relevance [23]. Most areas in the trimap have the same value,
making convolution neural networks with small kernels inefficient in
extracting features from trimaps. Different from the traditional manner, we
propose a new form of trimap named tri-token with inspirations from the [cls]
token in ViT. We utilize three tokens to represent three kinds of semantic
information in the trimap: foreground, background, and unknown area. Based on
the proposed tri-token, we could directly introduce these semantic information
into the self-attention mechanism. The Transformer module could identify which
features are from the known areas and which are from the unknown areas without
any range limitation. In addition, profiting from the semantic-representation
capability of our proposed tri-token, we could introduce trimap information to
any depth of both Transformer and convolutional neural networks (CNNs).
Experiments on various SOTA methods verify that the performance could be
further improved by only replacing the traditional trimap with our tri-token.

TABLE I: Performance of transparent totally (TT) and transparent partially (TP) objects on the Composition-1k test set. TT objects are those whose entire image is highly transparent, while TP denotes objects with the significant known foreground. Methods | MSE$\downarrow$ | SAD$\downarrow$
---|---|---
TT | TP | TT+TP | TT | TP | TT+TP
IndexNet [6] | 22.87 | 8.9 | 13 | 110.3 | 18.08 | 45.8
GCAMatting [7] | 15.89 | 6.2 | 9.1 | 85.72 | 13.68 | 35.3
MGMatting [24] | 13.01 | 4.65 | 7.18 | 77.88 | 11.87 | 31.76
TransMattingV1 | 7.49 | 3.40 | 4.58 | 59.37 | 10.35 | 24.96
TransMattingV2 | 6.94 | 3.26 | 4.37 | 55.47 | 10.25 | 23.82

Besides, there has not been any test bed for images with transparent or non-
salient foreground objects. Previous datasets mainly focus on salient and
opaque foregrounds, like animals [25] and portraits [26, 23], which have
significantly been investigated. To further help the community to dig into the
transparent and non-salient cases, we collect 460 high-solution natural images
with large unknown areas and manually label their alpha mattes.

To summarize, our main contributions are as follows:

  1. 1.

We propose a Transformer-based model (TransMatting) with a big receptive field
to help extract global features from images, especially for transparent
objects. An MGF module is also introduced to guide the integration of multi-
scale features with these global features.

  2. 2.

We redesign the trimap in a semantic tri-token manner to directly integrate
with deep features. The tri-token could introduce trimap information to image
features flexibility by reducing the domain gap between them.

  3. 3.

We build a high-resolution matting dataset with 460 images of the transparent
or non-salient foreground. The dataset will be released to promote the
development of matting research.

  4. 4.

Experiments on four matting datasets demonstrate that the proposed
TransMatting method outperforms the current SOTA methods. And the proposed
tri-token could boost both Transformer and convolutional SOTA methods,
indicating the great utilization potentiality in image matting.

A preliminary conference version of this work appeared in [27]. On the basics
of [27], we extend it in threefolds. (1) We extend the network (named as
TransMattingV1) proposed in [27] to TransMattingV2 by introducing our proposed
tri-token to both Transformer and convolutional modules. Thus we could boost
the performance of any off-the-shelf deep network by replacing the traditional
trimap with our tri-token. (2) We further investigate some critical designs of
the tri-token, including more introduction positions, initialization methods,
and interpretability. (3) By introducing the tri-token to both the CNN local
extractor and Transformer blocks, we show the superiority of TransMatting in
both composite and real-world images.

##  2 Related Works

###  2.1 Traditional Matting Methods

Traditional matting methods can be divided into two categories: sampling-based
and propagation-based methods. These methods mainly rely on low-level
features, like color, location, etc. The sampling-based methods [8, 9, 5, 10,
11, 12] first predict the colors of the foreground and background by
evaluating the similarity of colors between the known foreground, background
and unknown area in samples, and then predict alpha mattes. Various sampling
techniques have been investigated, including colour cluster sampling[12], edge
sampling[11], ray casting[10], etc. The propagation-based methods [1, 13, 4]
propagate the information from the known foreground and background to the
unknown area by solving the sparse linear equation system[3], the Poisson
equation system[28], etc., to obtain the best global optimal alpha.

###  2.2 Deep-Learning Matting Methods

In recent decades, deep learning technologies have boomed in various fields of
computer vision. The same goes for the image matting task. [29] combines the
sampling and deep neural network to improve the accuracy of alpha matting
prediction.

Based on providing a larger dataset Composition-1k [2], DIM utilizes an
encoder-decoder model to directly predict alpha mattes, which effectively
improves the accuracy. IndexNet [6] proposes a learnable index function to
unify upsampling operators for image matting and other three dense prediction
tasks. [30] introduces semantic classification information of the matting
region and uses learnable weights and multi-class discriminators to revise the
prediction results. [24] proposes a general matting framework, which is
conducive to obtaining better results under the guidance of different
qualities and forms. [23] further mines the information of the RGB map and
trimap and fuses the global information from these maps for obtaining better
alpha mattes. All of the above methods use trimap as guidance. Some trimap-
free methods can predict alpha mattes without using trimap. However, the
accuracy of these trimap-free methods still has a big gap compared to that of
the trimap-guided ones [31, 32, 33, 34], indicating that the trimap could help
the model to capture information efficiently.

###  2.3 Vision Transformer

The Transformer is firstly proposed in [35] to model long-range dependencies
for machine translation and has demonstrated impressive performance on NLP
tasks. Inspired by this, numerous attempts have been made to adapt
transformers for vision tasks, and promising results have been shown for
vision fields such as image classification, objection detection, semantic
segmentation, etc. In particular, ViT [16] divides the input image into
patches with a size of 16 $\times$ 16 and feeds the patch sequences to the
vanilla Transformer model. To help the training process and improve the
performance, DeiT [17] proposes a teacher-student strategy, which includes a
distillation token for the student to learn from the teacher. Later, Swin
[18], PVT [36], Crossformer [37], and HVT [38] combine the Transformer and
pyramidal structure to decrease the number of patches progressively for
obtaining multi-scale feature maps. To reduce computing and memory complexity,
Swin, HRFormer [39], and CrossFormer apply local-window self-attention in
Transformer, which also shows superior or comparable performance compared to
the counterpart CNNs. The powerful self-attention mechanism in Transformer
shows great advantages over CNN by capturing global attention of the whole
image. However, some researchers [40] argue that locality and globality are
both essential for vision tasks. Therefore, various researchers have tried
combining the locality of CNN with the globality of Transformer to improve
performance further. LocalViT [40] brings depth-wise convolutions to vision
transformer to combine self-attention mechanism with locality, and shows great
improvement compared to the pure Transformer, like DeiT, PVT, and TNT [41].

##  3 Matting Dataset

According to the transparency of foregrounds, we could divide the images into
two types: 1) Transparent Partially (TP): there are significant foreground and
uncertainty areas, and the foreground areas can provide information for the
prediction of uncertainty areas. For example, when the foreground is human,
the opaque and unknown regions are the hair or clothes. 2) Transparent Totally
(TT): there are minor or non-salient foreground areas, and the entire image is
semi-transparent or highly transparent. These images include glass, plastic
bags, fog, water drops, etc.

As illustrated in Tab. II, we select four popular image matting datasets for
comparison, including DAPM [26], Composition-1k [2], Distinctions-646 [42],
and AIM-500 [15]. The DAPM dataset only consists of portraits with no
translucent or transparent objects. The Composition-1k dataset contains
multiple categories, while most images are portraits and there are only 86 TT-
type objects among them. The Distinctions-646 dataset also mainly consists of
portraits and has a similar number (79) of TT objects. The same condition is
also in the AIM-500 dataset, which contains only 76 (15.2%) TT-type images
(corresponding to the Salient Transparent/Meticulous type and the Non-Salient
type as defined in the original dataset).

As we can see, the transparent objects in the above datasets only occupy a
small portion. This may be because it is much more difficult to label
transparent objects than other objects, limiting the progress of transparent
objects in the matting field. In this work, we propose the first large-scale
dataset targeting various highly transparent objects called Transparent-460
dataset. Our Transparent-460 dataset includes 460 high-quality manually-
annotated alpha mattes, where 410 images are for training and 50 for testing.
Furthermore, to our best knowledge, the resolution of our Transparent-460 is
the highest (the average resolution is up to 3820 $\times$ 3766) among all
datasets with high transparent objects. We believe this new matting dataset
will greatly advance the matting research on objects with massive transparent
areas.

TABLE II: Comparison between different public matting datasets.  Image Matting Dataset | Total Num | TT Num | Resolution
---|---|---|---
DAPM [26] | 2000 | 0 | 800$\times$600
Composition-1k [2] | 481 | 86 | 1297$\times$1082
Distinction-646 [42] | 646 | 79 | 1727$\times$1565
AIM-500 [15] | 500 | 76 | 1260$\times$1397
Transparent-460 (Ours) | 460 | 460 | 3820$\times$3766

##  4 Methodology

Figure 1: The structure of our TransMatting. Unlike vanilla matting methods
that concatenate the trimap with the image, we feed the RGB image into the CNN
local extractor and introduce tri-token directly to extracted deep features.
We design two ways to introduce tri-token to both convolutional and
Transformer models. To better model transparent objects with few known
foregrounds, the TGTB module is proposed to extract further long-range
features. And the MGF module is responded to fusing multi-level features with
global guidance.

###  4.1 Baseline Structure

To extract both local and global features, we combine CNN and the Transformer
model as our baseline encoder, as illustrated in Fig. 1. Specifically, based
on the ResNet34-UNet [24, 7], we only use the first two stage of the ResNet34
as our CNN local extractor. And then, a stack of Swin Transformer blocks [18]
are adopted as the Transformer encoder. Other components are the same as the
original ResNet34-UNet. It is worth noting that this Transformer-based
baseline structure achieves a comparable performance with current matting
methods. And we will introduce our main contribution as follows.

###  4.2 Tri-token

Almost all SOTA methods [23, 24, 7, 2, 43, 30, 44] use trimap as a guide and
directly concatenate the RGB image with the trimap as the model’s input.
However, the modalities of the RGB image and trimap are quite different. The
RGB image scales from 0 to 255 and shows fine low-level features like texture,
color similarity, etc. The trimap includes three values containing high-level
semantic information, like shape, location, etc., [23]. It is not suitable to
use one extract to extract features from these two modalities. Furthermore,
most deep models utilize pre-trained weights on the classification task (with
three channels in the input) for backbone initialization, the concatenation of
the RGB image and the trimap as input (four channels) will break the pre-
trained weights and affect the performance. Thus, their direct concatenation
is not the most efficient way to extract features from the trimap.

To the best of our knowledge, we are the first to attempt to explore different
harmonising manners of the RGB image and trimap rather than simply
concatenating them.

Inspired by the [cls] token in Vision Transformer, we design a new tri-token
(shown in Fig. 1) manner, aiming to introduce the high-level semantic
information directly into the deep features to replace the inefficient
concatenation method.

Given a vanilla $Trimap\in\mathbb{R}^{H\times W}$, we generate three learnable
tokens (denoted as $Token_{i}$, $i=\\{0,1,2\\}$) with different initialization
to represent the known foreground, known background, and unknown areas,
respectively. Every token is a 1D vector, that is,
$Token_{i}\in\mathbb{R}^{C}$. Then we replace every pixel in the trimap with
the corresponding tri-token values to generate the tri-token map, formulated
as:

$Trimap[Trimap==i]=Token_{i},i=\\{0,1,2\\}$ (2)

In this manner, the trimap is converted to a more flexible manner. With an
additional channel dim, the tri-token could easily introduce semantic and
location information to high-level abstract feature maps. Besides, the
learnable tri-token have the ability to learn to align trimap spaces and image
representation spaces. The following will introduce how to utilize tri-token
to guide both Transformer and convolutional models.

###  4.3 Tri-token Guided Image Matting Network

####  4.3.1 Tri-token Guided Transformer Block

Due to the large proportion of uncertainty areas in images of transparent
objects, global connectivity is much more important to mine features from far
known patches. CNN does not have a big enough receptive field to cover the
whole foreground object [14], which leads to poor estimation of pixels outside
receptive fields. In contrast, the receptive field of the Transformer could
extend to the whole image with the self-attention mechanism. Thus we adopt the
Transformer model here to extract long-range features of transparent objects.

The Transformer model consists of multi-head self-attention (MHSA) and Multi-
layer Perception (MLP) modules. The self-attention mechanism can be thought of
as a mapping between a query and a collection of key-value pairs. The output
is a weighted sum of the values, and the weights are assigned by the
compatibility function between the query and the relevant key. This can be
implemented by Scaled Dot-Product Attention [35], in which a $softmax$
function is used to activate the dot products of query and all keys for
obtaining the weights. MHSA means that more than one self-attention is
performed in parallel.

Like [18, 37, 39], we use non-overlapping windows whose size is $M\times M$ to
divide the feature maps. The MHSA is performed within each window. The
formulations of vanilla attention and our tri-token attention in a specific
window are shown as follows:

$Attention(Q,K,V)=\mathcal{S}(QK^{T}/\sqrt{d})V$ (3)

$Tri\mbox{-}token\
Attention(Q,K,V)=\mathcal{S}((Q+Tri\mbox{-}token)K^{T}/\sqrt{d})V$ (4)

where $Q,K,V\in\mathbb{R}^{M^{2}\times d}$ represent the query, key, and value
in the attention mechanism, respectively. $d$ is the query/key dimension and
$\mathcal{S}$ denotes the $softmax$ function. In the Tri-token Attention
formulation, $Q$, $K$, and $V$ are the same as that in the standard self-
attention. The $Tri\mbox{-}token$ is our proposed learnable _trimap_ that adds
to the query for forming a new tri-token guided query. In this way, our tri-
token attention mechanism can selectively aggregate contexts and evaluate
which region should be paid more attention to with the guidance of our
learnable tri-tokens.

In this way, we combine the self-attention and the tri-token to focus on more
valuable regions by considering the relationship among known foreground, known
background and uncertainty areas and finally achieve the best performance. We
replace the vanilla Transformer block with our Tri-token Guided Transformer
Block (TGTB) every five blocks in the Transformer encoder.

Algorithm 1 Pseudo codes to convert traditional trimap to our proposed tri-
token in PyTorch style.

⬇

1trimap = cv2.imread(’trimap.png’, 0) # [H, W]

2H, W = trimap.shape

3

4# convert to tri-token

5dim = 64

6foreground_token = nn.Parameter(torch.zeros(1, 1, dim))

7uncertain_token = nn.Parameter(torch.zeros(1, 1, dim) + 1)

8background_token = nn.Parameter(torch.zeros(1, 1, dim) + 2)

9# build a tri-token map for convenience

10tri_token_map = torch.zeros(H, W, dim)

11tri_token_map[trimap == 0] = background_token

12tri_token_map[trimap == 128] = uncertain_token

13tri_token_map[trimap == 255] = foreground_token

####  4.3.2 Tri-token Guided Convolutional Network

As convolutional networks are still commonly used for image matting, it is
quite meaningful to extend our tri-token to boost current CNN-based matting
methods. Different from the Transformer model, which is based on the self-
attention mechanism, convolutional networks mainly consist of a stack of
convolutional layers. There are no ready-made attention modules in it to
introduce tri-token information. To make our modification general and simple,
we employ the additive operation (formulated in Eq. 5) for convolutional
models. Specifically, after some convolution layers, a feature map is
extracted from the input image. Every pixel vector in the feature map
represents the semantic features of a small input image patch. According to
the trimap, we could add the corresponding tri-token to the pixel vector to
introduce high-level tri-token information into feature maps. In this way, the
tri-token can guide the network to distinguish foreground, background, and
uncertain areas to pay more attention to where it needs to focus. The
$Tri\mbox{-}token\mbox{-}map$ in Eq. 5 can be generated efficiently with Alg.
1.

$x=Conv_{2}(Conv_{1}(x)+Tri\mbox{-}token\mbox{-}map)$ (5)

###  4.4 Multi-scale Global-guided Fusion Module

In the multi-scale feature pyramid structure, in-depth features contain more
global information, while shallow features have rich local information like
texture, color similarity, etc. Fusing these features is vital for accurately
predicting alpha mattes for high transparent objects [33]. Although the direct
sum operation can realize feature fusion, the details in the shallow features
may attenuate the impact of the advanced semantics, resulting in some subtle
regions missing [33]. To address this issue, we propose a Multi-scale Global-
guided Fusion (MGF) module in the decoder process (see Fig. 1 for details),
with both the non-background information and the advanced semantic features as
guidance, to fuse the high-level semantic information and the lower ones
effectively.

Specifically, we denote three adjacent features from shallow to deep as
$T_{n-1}$, $T_{n}$, and $T_{n+1}$. The $T_{n-1}$ is first down-sampled, then
the Hadamard product is employed between the non-background mask and $T_{n-1}$
to extract the low-level features of non-background, which helps to reduce the
impact of complex background influence. This can guide the network to pay more
attention to the foreground and unknown areas. After that, the $T_{n-1}$ is
concatenated with $T_{n}$, and a convolution layer is performed to align the
channel of fused features. We mark this feature as $T_{f}$.

For the $T_{n+1}$, we first perform a global average pooling to generate
channel-wise statistics and then use two fully connected (FC) layers to
squeeze channels. As shown in Fig. 1, features output from the two FC layers
are denoted as $\gamma$ and $\beta$, separately.To fully capture channel-wise
dependencies, we add a sigmoid function to activate $\gamma$ and perform
broadcast multiplication with $T_{f}$ for channel re-weighting. After that,
broadcast addition is performed between the channel-weighted feature and
$\beta$. A convolution layer is used to fuse information from different
groups. Notably, a skip connection from $T_{n}$ is employed for obtaining the
final fused features of MGF.

In short, considering that fusing low-level features directly may cause a
negative impact on the advanced semantics [33], two techniques are proposed
here. Firstly, the non-background mask is introduced into the fusion process
to filter out the complex background information and further help to
concentrate more attention on the foreground and unknown areas. Secondly, the
global channel-wise attention from higher-level features is used for re-
weighting and enhancing the important information in the fused features.

###  4.5 Loss Function

Following [24], we use three kinds of losses, including alpha loss
($\mathcal{L}_{\alpha}$), compositing loss [2] ($\mathcal{L}_{comp}$), and
Laplacian loss [45] ($\mathcal{L}_{lap}$). As formulated below, the weights
are set as 0.4, 1.2, and 0.16, respectively.

$\mathcal{L}_{final}=0.4*\mathcal{L}_{alpha}+1.2*\mathcal{L}_{comp}+0.16*\mathcal{L}_{lap}$
(6)

##  5 Experiments

Figure 2: Samples from our Transparent-460 dataset. The foreground objects are
highly transparent and occupy a large area of the image, which is very
challenging for current image matting methods. All images are high-resolution.
Thus, it is better to zoom in to find subtle details.

###  5.1 Dataset

Composition-1k [2] contains 493 and 50 unique foreground objects as training
and test sets, respectively. Every foreground object is composited with 100
background images from COCO [46] and 20 from Pascal VOC [47]. As a result,
there are 49,300 images for training and 1,000 images for testing.

Distinction-646 [42] comprises 646 distinct foreground objects. Similar to the
Composition-1k, 50 objects are divided as the test set. Following the same
composition rule, there are 59,600 and 1000 images for training and testing,
respectively.

AIM-500 [15] is a real-world benchmark, including many types of objects, like
humans, glass, grids, etc. It contains 500 natural images for testing the
performance of real-world matting methods.

Our Transparent-460 mainly consists of transparent and non-salient objects as
the foreground, like water drops, jellyfish, plastic bags, glass, crystals,
etc. We collect 460 high-resolution images and carefully annotate them with
Photoshop. Considering the transparent objects are very meticulous, we keep
the origin resolution of all collected images up to 3820 $\times$ 3766 on
average. To our best knowledge, this is the first transparent object matting
dataset in such a high resolution. Some samples are illustrated in Fig. 2.

###  5.2 Evaluation Metrics

Following [45, 44, 6, 23], we use four metrics for evaluation, including the
Sum of Absolute Differences (SAD), Mean Squared Error (MSE), Gradient error
(Grad.) and Connectivity error (Conn.). It is notable that the unit of MSE
value is set to 1e-3 for easy reading.

###  5.3 Implementation Details

We use the PyTorch [48] to implement our proposed method. All the experiments
are trained for 200,000 iterations. We initialize our network with ImageNet
[49] pre-trained weights and initialize the background, uncertainty, and
foreground token in the tri-token with values of 0, 1, and 2, respectively.
The ablation experiments in Tab. III, IV, V, VI are done with 2 NVIDIA Tesla
V100 GPUs with a batch size of 32. Moreover, to compare our method with the
existing SOTA methods, we use a batch size of 64 with 4 NVIDIA Tesla V100 GPUs
to train our proposed method in Tab. VII, VIII, IX. The Adam optimizer is
utilized, and the initial learning rate is set to 1e-4 with the same learning
rate decay strategy in [24, 50]. For a fair comparison, we follow the same
data augmentation as [7], like random crop, rotation, scaling, shearing, etc.
Moreover, trimaps for training are generated using dilation and erosion ways
on alpha images by random kernel sizes from 1 to 30. Finally, we crop 512×512
patches on the center of the unknown area of alpha and composition with
backgrounds from COCO. The same settings are applied to Composition-1k,
Distinction-646, and our collected Transparent-460.

###  5.4 Ablation Study

To evaluate different designs of our new proposed tri-token and MGF module, we
designed some ablation studies on the Composition-1k test set.

TABLE III: The effectiveness of our proposed tri-token strategy and MGF module on the Composition-1k test set. Tri-token | MGF | SAD $\downarrow$ | MSE $\downarrow$ | Grad. $\downarrow$ | Conn.$\downarrow$
---|---|---|---|---|---
CNN | Transformer
|  |  | 29.14 | 6.34 | 12.06 | 25.21
| $\checkmark$ |  | 27.45 | 5.66 | 11.77 | 24.30
$\checkmark$ | $\checkmark$ |  | 26.40 | 5.22 | 11.03 | 22.47
|  | $\checkmark$ | 27.21 | 5.57 | 11.23 | 23.25
| $\checkmark$ | $\checkmark$ | 26.83 | 5.22 | 10.62 | 22.14
$\checkmark$ |  | $\checkmark$ | 26.43 | 5.24 | 10.97 | 22.41
$\checkmark$ | $\checkmark$ | $\checkmark$ | 26.36 | 5.08 | 10.24 | 21.68

Evaluate the effectiveness of our proposed modules. The quantitative results
under the SAD, MSE, Grad., and Conn. with and without our proposed tri-token
and MGF module are illustrated in Tab. III. As we can see, with the tri-token
introduced in Transformer (TGTB), the four metrics decrease from 29.14, 6.34,
12.06, and 25.21 to 27.45, 5.66, 11.77, and 24.30, respectively. Combined with
introducing the tri-token in the CNN local extractor, the prediction error
could further decrease to 26.40, 5.22, 11.03, and 22.47, respectively. It
indicates that, for both the Transformer and convolutional networks, our
redesigned tri-token is more effective in helping the model to distill the
advanced semantics and pay attention to critical areas than traditional
concatenating to the input image. Compared with the baseline model (the first
row), the addition of the MGF module could solely achieve similar performance,
which decreases by 1.93, 0.77, 0.83, and 1.96 on four metrics. This indicates
that our proposed multi-scale feature fusion strategy can also help the
decoder to harmonize local and global features to guide information
integration. On the basis of the MGF module, whether adding the tri-token to
the convolutional or Transformer module, our model can achieve better
performance. When combined with the tri-token on two networks and the MGF
module, the model achieves the best performance of 26.36, 5.08, 10.24, 21.68
in terms of SAD, MSE, Grad., and Conn., which improves 2.78, 1.26, 1.82, and
3.53 compared with the baseline strategy, showing the effectiveness of our
proposed tri-token and the MGF module.

TABLE IV: Quantitative results on the Composition-1k test set with different initialization methods of tri-token. Method | Init Method | SAD $\downarrow$ | MSE $\downarrow$ | Grad. $\downarrow$ | Conn. $\downarrow$
---|---|---|---|---|---
MGMatting | (-1, 0, 1) | 28.56 | 5.53 | 11.61 | 24.98
(0, 1, 2) | 28.34 | 5.45 | 10.96 | 24.62
random | 28.34 | 5.51 | 11.12 | 24.70
TransMattingV2 | (-1, 0, 1) | 26.81 | 5.16 | 11.24 | 23.11
(0, 1, 2) | 26.36 | 5.08 | 10.24 | 21.68
random | 26.38 | 5.09 | 10.68 | 22.50

Determine different initialization methods for tri-token. Different from the
vanilla trimap, our proposed tri-token is learnable and could update itself as
the model training. Considering that initialization is essential for deep
learning methods, we further explore different approaches to initialize our
tri-token: pre-defined values for every token or totally random. For the pre-
defined manner, we initialize background, uncertainty, and foreground with
values $a$, $b$, and $c$, respectively, denoted as ($a$, $b$, $c$). We conduct
experiments on three initialization approaches: (-1, 0, 1), (0, 1, 2), and
random initialization. The results are illustrated in Tab. IV. As we can see,
the proposed tri-token is robust with different initialization methods. Among
these methods, we can observe that the (0, 1, 2) initialization performs best
for both CNN-based MGMatting and our Transformer-based TransMatting. But the
improvement is limited, indicating that the initialization method is not
critical for our tri-token updating.

Determine where to introduce the tri-token in our TransMatting. The tri-token
is proposed to introduce high-level semantic and position information to the
deep model. As we know, the shadow features in deep models have a big
resolution which reserves more position information. In contrast, the deep
layer could extract more abstract semantic features, which is suitable for
mutual learning with the tri-token. To determine which position is more
suitable to introduce the tri-token, we conduct experiments with different
positions of the Transformer encoder in our TransMatting model. There are four
stages in the Transformer encoder. We adopt the stage number $i$
($i\in\\{1,2,3,4\\}$) to represent the insertion position. For example,
position 3 indicates that the tri-token is introduced at the beginning of
stage 3. The experiment results on Composition-1k are illustrated in Tab. V.
By comparing the performance of different introduction positions for tri-
token, we conclude that introducing tri-token in multiple positions achieves
the best performance.

TABLE V: Quantitative results on the Composition-1k test set with different positions to introduce tri-token into our TransMattingV1.  Position | SAD $\downarrow$ | MSE $\downarrow$ | Grad. $\downarrow$ | Conn. $\downarrow$
---|---|---|---|---
1 | 31.68 | 7.24 | 14.20 | 27.42
2 | 29.32 | 6.66 | 13.42 | 25.16
3 | 27.25 | 5.34 | 10.89 | 22.12
4 | 29.50 | 6.20 | 13.18 | 25.23
3, 4 | 27.12 | 5.20 | 11.07 | 22.59
1,2,3,4 | 26.83 | 5.22 | 10.62 | 22.14
TABLE VI: Quantitative results on the Composition-1k test set with different positions to introduce the tri-tokens into convolutional networks on SOTA CNN methods.  Methods | Position | SAD $\downarrow$ | MSE $\downarrow$ | Grad. $\downarrow$ | Conn. $\downarrow$
---|---|---|---|---|---
GCAMatting [7] | - | 35.3 | 9.1 | 16.9 | 32.5
1 | 33.71 | 7.75 | 15.80 | 30.28
2 | 33.79 | 8.09 | 15.51 | 30.16
3 | 32.72 | 7.48 | 14.05 | 29.19
4 | 31.32 | 7.02 | 13.24 | 27.67
3,4 | 32.41 | 7.45 | 14.62 | 29.08
| 1,2,3,4 | 32.38 | 7.52 | 14.92 | 28.77
MGMatting [24] | - | 31.5 | 6.8 | 13.5 | 27.3
1 | 28.34 | 5.45 | 11.08 | 24.83
2 | 28.85 | 5.52 | 11.43 | 24.90
3 | 28.31 | 5.52 | 11.37 | 24.73
4 | 28.32 | 5.41 | 10.96 | 24.62
3,4 | 28.82 | 5.61 | 11.39 | 25.12
| 1,2,3,4 | 28.59 | 5.59 | 11.37 | 24.99

Determine where to introduce tri-token in convolutional networks. As the
introduction manner of the tri-token in convolutional models differs from the
Transformer, we conduct experiments on Composition-1k to find the best
introduction position for convolutional networks. Since our TransMatting only
has a few layers in the CNN local extractor, we conduct experiments on two
convolutional SOTA methods: GCAMatting and MGMatting. The results are
illustrated in Tab. VI. The position “-” indicates no tri-token introduced,
and the trimap is concatenated to the image. As we can see, replacing trimap
with our tri-token achieves significant improvements on all metrics with any
position, indicating that our tri-token is a highly flexible and efficient
design. We can also find that the performance gets better as the introduction
position goes deeper. The best performance is achieved when tri-token is
introduced to stage four: outperform the trimap strategy with about 3 - 4
improvements on SAD. This indicates that the information in trimap is really
high-level and more suitable for interacting with deep features in
convolutional models.

However, unlike the Transformer model, introducing the tri-token to multiple
positions decreases the performance of GCAMatting. The SAD and MSE increase
from 31.32 and 7.02 to 32.41 and 7.45, respectively, when introducing the tri-
token to both stage 3 and stage 4. The performance further decreases to 32.38
and 7.52 when introduced to all four stages. The same trends are observed in
MGMAtting. We guess this is caused by the different introduction manner
between convolutional models and Transformer ones. The straightforward
addition operation makes it hard for the tri-token to simultaneously suit
different features from different stages.

###  5.5 Comparison with Prior Works

To evaluate the performance of our proposed method, we compare it with current
SOTA image matting models on three synthetic image matting datasets
(Composition-1k, Distinction-646, and our collected Transparent-460) and one
real-world dataset (AIM-500).

####  5.5.1 Experiments on Synthetic Datasets

TABLE VII: The quantitative results on Composition-1k test set. † denotes results with test-time augmentation. Following IndexNet, the matting refinement stage is not applied in DIM∗ for simplicity and fair comparison.  Methods | SAD $\downarrow$ | MSE $\downarrow$ | Grad. $\downarrow$ | Conn. $\downarrow$
---|---|---|---|---
AlphaGAN [51] | 52.4 | 30 | 38 | 53
DIM [2] | 50.4 | 14 | 31.0 | 50.8
IndexNet [6] | 45.8 | 13 | 25.9 | 43.7
AdaMatting [44] | 41.7 | 10 | 16.8 | -
ContextNet [45] | 35.8 | 8.2 | 17.3 | 33.2
TIMI-Net [23] | 29.08 | 6.0 | 12.9 | 27.29
FBAMatting [52] † | 25.8 | 5.2 | 10.6 | 20.8
DIM∗ [2] | 54.6 | 17 | 36.7 | 55.3
DIM∗ \+ Tri-token | 53.3 | 16.9 | 33.54 | 53.64
GCAMatting [7] | 35.3 | 9.1 | 16.9 | 32.5
GCAMatting + Tri-token | 31.32 | 7.02 | 13.24 | 27.67
MGMatting [24] | 31.5 | 6.8 | 13.5 | 27.3
MGMatting + Tri-token | 28.32 | 5.41 | 10.96 | 24.62
TransMattingV1 | 24.96 | 4.58 | 9.72 | 20.16
TransMattingV2 | 23.82 | 4.37 | 9.43 | 18.86
Figure 3: Visual comparison of our TransMatting against SOTA methods on the
Composition-1k test set. Figure 4: Visual comparison of our TransMatting
against SOTA methods on the Distinction-646 test set.

Testing on Composition-1k. We show some quantitative and qualitative results
on Tab. VII and Fig. 3, respectively. Without any test time augmentations, our
proposed TransMattingV1 model outperforms other SOTA methods on all four
evaluation metrics by only training on the Composition-1k training set. As
illustrated in Tab. VII, our model decreases the MSE and Grad. heavily: from
5.2, 10.6 to 4.58 and 9.72, respectively, indicating the effectiveness of our
TransMattingV1. By further introducing the tri-token to the CNN local
extractor, our TransMattingV2 performs better than TransMattingV1, especially
on SAD and Conn., improving by 1.14 and 1.3, respectively. Fig. 3 visualizes
the qualitative comparisons of two cases on the Composition-1k test set. As we
can see in the first row, the color of the dewdrop is similar to the
background, for which previous methods are all mistaken. In contrast, thanks
to the large receptive field and tri-token guided design, our proposed model
learns image context and object structure effectively, contributing to
sophisticated performance in such a challenging region. Besides, our proposed
model can also accurately estimate the TT-type objects whose background is
complex. For example, in the second row of Fig. 3, the background is so
complicated that the previous methods are hard to describe the details. It is
worth noting that our TransMattingV2 achieves more high-quality alpha mattes
than TransMattingV1, indicating that our tri-token helps to distinguish the
foreground and background in deep features.

To evaluate the universality of our proposed tri-token, we introduce it to
three current SOTA methods: DIM [2], GCAMatting [7], and MGMatting [24]. We
follow [6] to drop the matting refinement stage in DIM for simplicity and fair
comparison. The results are illustrated in Tab. VII. As we can see, our
proposed tri-token boosts the performance of all three SOTA methods with a big
margin. Especially for recent proposed GCAMatting and MGMAtting, by replacing
the traditional concatenation with our proposed tri-token, the SAD is
decreased by 3.98 and 3.18, respectively. This proves the effectiveness of the
proposed tri-token strategy in existing SOTA methods and indicates a great
potential to replace the concatenation strategy with the proposed tri-token in
a wide range of image matting methods.

As illustrated in Tab. I, to further verify our method in boosting the
performance of TT-type objects, we analyze two types of objects separately. We
can find that our TransMattingV1 achieves 42.4% and 23.7% improvements in
terms of MSE and SAD on TT-type compared with MGMatting, which is the key
factor in improving overall performance. Notably, our TransMattingV2 further
improves MSE and SAD by 7.3% and 6.5% on TT-type compared to the
TransMattingV1. In addition, our model can also achieve a good improvement on
TP-type, although not as significant as TT-type. Thus, we can conclude that
our proposed method can model TT-type objects with long-range features, and
our tri-token design can assist our method in better understanding the
semantic information in the trimap and integrating it into deep features as
well as long-range features to further improve performance.

Testing on Distinction-646. Distinction-646 comprises of more distinct
foreground images than Composition-1k. Tab. VIII compares the performance of
our TransMatting model with other SOTA methods on Distinction-646. For a fair
comparison, we follow the whole inference protocol in [42, 24] to calculate
the metrics based on the whole image. Without any additional tuning, our
TransMattingV1 outperforms all the SOTA methods. Similarly, our TransMattingV2
could further improve from introducing tri-token in convolutional layers. We
also illustrate some visual comparisons in Fig. 4, especially the ones without
distinct foregrounds, like grids. As we expected, our proposed TransMatting
model could predict more precise alpha values of highly transparent objects
compared with other SOTA methods.

TABLE VIII: The quantitative results on Distinctions-646 test set.  Methods | SAD $\downarrow$ | MSE $\downarrow$ | Grad. $\downarrow$ | Conn. $\downarrow$
---|---|---|---|---
KNNMatting [1] | 116.68 | 25 | 103.15 | 121.45
DIM [2] | 47.56 | 9 | 43.29 | 55.90
HAttMatting [42] | 48.98 | 9 | 41.57 | 49.93
GCAMatting [7] | 27.43 | 4.8 | 18.7 | 21.86
MGMatting [24] | 33.24 | 4.51 | 20.31 | 25.49
TransMattingV1 | 25.65 | 3.4 | 16.08 | 21.45
TransMattingV2 | 24.19 | 3.0 | 14.42 | 19.14
Figure 5: Visual comparison of our TransMatting against SOTA methods on our Transparent-460 test set. TABLE IX: The quantitative results on our proposed Transparent-460 test set.  Methods | SAD$\downarrow$ | MSE$\downarrow$ | Grad.$\downarrow$ | Conn.$\downarrow$
---|---|---|---|---
IndexNet [6] | 573.09 | 112.53 | 140.76 | 327.97
MGMatting [24] | 111.92 | 6.33 | 25.67 | 103.81
TransMattingV1 | 88.34 | 4.02 | 20.99 | 82.56
TransMattingV2 | 87.26 | 4.06 | 20.86 | 80.6

Testing on our Transparent-460. Based on their release codes, we train
IndexNet and MGMatting methods on our dataset and compare them with ours in
Tab. IX. Our Transparent-460 dataset mainly focuses on transparent and non-
salient foregrounds, which is very difficult for existing image matting
methods. Surprisingly, as illustrated in Tab. IX, our TransMattingV1 achieves
a promising result with only 4.02 MSE and surpasses other methods by a large
margin on SAD, Grad., and Conn. In addition, our TransMattingV2 has further
improved compared to TransMattingV1, especially on Conn. Furthermore, to
evaluate the generalization performance of our model, we train our
TransMatting on the Composition-1k training set and directly test it on the
Transparent-460 test set. The results are shown in Tab. X. Thanks to the large
receptive field and well-designed multi-scale fusion module, our model reduces
more than half of the SAD, MSE, and Conn. As shown in Fig. 5, we visualize the
comparison results of two representative TT-type objects, a plastic bag and a
glass bottle. We can see that our TransMatting shows more sophisticated and
accurate alpha mattes than other methods. In short, both quantitative and
generalization comparisons prove the effectiveness and superiority of our
proposed method.

TABLE X: Generalization results on our proposed Transparent-460 test set.  Methods | SAD$\downarrow$ | MSE$\downarrow$ | Grad.$\downarrow$ | Conn.$\downarrow$
---|---|---|---|---
DIM [2] | 351.98 | 53 | 151.37 | 292.04
IndexNet [6] | 434.14 | 74.73 | 124.98 | 368.48
MGMatting [24] | 344.65 | 57.25 | 74.54 | 282.79
TIMI-Net [23] | 328.08 | 44.2 | 142.11 | 289.79
TransMattingV1 | 192.36 | 20.96 | 41.8 | 158.37
TransMattingV2 | 181.94 | 18.37 | 40.99 | 159.53
TABLE XI: Generalization results on AIM-500. All the models are trained with the Composition-1k training set.  Methods | SAD $\downarrow$ | MSE $\downarrow$ | Grad. $\downarrow$ | Conn. $\downarrow$
---|---|---|---|---
IndexNet [6] | 28.49 | 28.8 | 18.15 | 27.95
CA [45] | 26.33 | 26.6 | 18.89 | 25.05
CA+DA [45] | 32.15 | 38.8 | 30.25 | 31.00
GCAMatting [7] | 35.10 | 38.9 | 25.67 | 35.48
$A^{2}$U [53] | 30.38 | 30.7 | 22.60 | 30.69
SIM [30] | 27.05 | 31.1 | 23.68 | 27.08
TransMattingV1 | 16.55 | 14.06 | 12.35 | 15.61
TransMattingV2 | 15.70 | 12.20 | 11.36 | 15.05

####  5.5.2 Experiments on Real-World Dataset

Generalization on AIM-500. Besides synthetic benchmarks, we also validate our
method on real-world images, which is more challenging than synthetic ones.
Specifically, we train the network on the synthetic Composition-1k training
set and directly evaluate on AIM-500. The results are shown in Tab. XI. As we
can see, without any extra data augmentation or fine-tuning, our model
surpasses other SOTA methods with a big margin. The performance of
TransMattingV2 is better than TransMattingV1, thanks to the introduced tri-
token in the convolutional network. Furthermore, AIM-500 also has some real-
world transparent objects, like glass, fire, plastic bags, etc. Although other
methods fail to process such difficult cases, our model still has superior
performance compared with them on the generalization results, which further
proves the effectiveness of our model on transparent objects.

Figure 6: Visualization of attention maps ($q@k$) of the self-attention
mechanism. The color indicates the attention weight between the red point and
other image pixels. (a) is the input image, (b) and (c) represent the
attention maps of the traditional concatenation strategy and our tri-token
manner. In (d), the tri-token values are replaced from uncertainty to
background values, and the model is deceived into paying attention to the
background, indicating the guiding efforts of our tri-token.

##  6 Analysis of the Tri-token

The tri-token is proposed to effectively introduce semantic and position
information in trimap to deep features. We hypothesize that this could help
the model find where it should pay more attention. In Fig. 6, we visualize
attention maps of the self-attention mechanism according to the red-marked
point. As the red point belongs to the transparent glass cup, the pixels
belonging to the cup should have a high weight. However, as illustrated in
Fig. 6 (b), many background pixels are highly activated with the concatenation
strategy. While with our tri-token (shown in Fig. 6 (c)), the background is
suppressive, and the model mainly concentrates on the foreground, indicating
that our tri-token can efficiently guide the model to distinguish different
areas. To further demonstrate the effectiveness of the tri-token, we replace
the token in the red point with background values. As we can see from Fig. 6
(d), the replaced tri-token misleads the model to mistakenly focus on the
background pixels with very high response, meaning that the model relies on
the guidance from our tri-token to distinguish foreground and background while
traditional concatenation loses much information in deep layers.

##  7 Conclusion

In this paper, we present a Transformer-based network for image matting
(TransMatting) to mine long-range features of foreground objects, especially
for transparent and non-salient ones. A multi-scale global-guided fusion
module is proposed to take the global information as a guide to fuse multi-
scale features for better modelling the uncertainty regions in transparent
objects. We also collect a high-resolution matting dataset of transparent
objects to serve as a test bed for future research. Furthermore, we redesign
the trimap as a unified representation to directly introduce semantic
information to deep features instead of traditional concatenation. Various
experiments demonstrate that it could boost both Transformer and convolutional
networks, indicating that the proposed tri-token has the potential to be a new
paradigm for image matting.

## References

  * [1] Q. Chen, D. Li, and C.-K. Tang, “Knn matting,” _IEEE transactions on pattern analysis and machine intelligence_ , vol. 35, no. 9, pp. 2175–2188, 2013\.
  * [2] N. Xu, B. Price, S. Cohen, and T. Huang, “Deep image matting,” in _Proceedings of the IEEE conference on computer vision and pattern recognition_ , 2017, pp. 2970–2979.
  * [3] A. Levin, D. Lischinski, and Y. Weiss, “A closed-form solution to natural image matting,” _IEEE transactions on pattern analysis and machine intelligence_ , vol. 30, no. 2, pp. 228–242, 2007.
  * [4] J. Sun, J. Jia, C.-K. Tang, and H.-Y. Shum, “Poisson matting,” in _ACM SIGGRAPH 2004 Papers_ , 2004, pp. 315–321.
  * [5] J. Wang and M. F. Cohen, “Optimized color sampling for robust matting,” in _2007 IEEE Conference on Computer Vision and Pattern Recognition_. IEEE, 2007, pp. 1–8.
  * [6] H. Lu, Y. Dai, C. Shen, and S. Xu, “Indices matter: Learning to index for deep image matting,” in _Proceedings of the IEEE/CVF International Conference on Computer Vision_ , 2019, pp. 3266–3275.
  * [7] Y. Li and H. Lu, “Natural image matting via guided contextual attention,” in _Proceedings of the AAAI Conference on Artificial Intelligence_ , vol. 34, no. 07, 2020, pp. 11 450–11 457.
  * [8] A. Berman, A. Dadourian, and P. Vlahos, “Method for removing from an image the background surrounding a selected object,” Oct. 17 2000, uS Patent 6,134,346.
  * [9] Y.-Y. Chuang, B. Curless, D. H. Salesin, and R. Szeliski, “A bayesian approach to digital matting,” in _Proceedings of the 2001 IEEE Computer Society Conference on Computer Vision and Pattern Recognition. CVPR 2001_ , vol. 2. IEEE, 2001, pp. II–II.
  * [10] E. S. Gastal and M. M. Oliveira, “Shared sampling for real-time alpha matting,” in _Computer Graphics Forum_ , vol. 29, no. 2. Wiley Online Library, 2010, pp. 575–584.
  * [11] K. He, C. Rhemann, C. Rother, X. Tang, and J. Sun, “A global sampling method for alpha matting,” in _CVPR 2011_. IEEE, 2011, pp. 2049–2056.
  * [12] E. Shahrian, D. Rajan, B. Price, and S. Cohen, “Improving image matting using comprehensive sampling sets,” in _Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition_ , 2013, pp. 636–643.
  * [13] P. Lee and Y. Wu, “Nonlocal matting,” in _CVPR 2011_. IEEE, 2011, pp. 2193–2200.
  * [14] Q. Liu, H. Xie, S. Zhang, B. Zhong, and R. Ji, “Long-range feature propagating for natural image matting,” in _Proceedings of the 29th ACM International Conference on Multimedia_ , 2021, pp. 526–534.
  * [15] J. Li, J. Zhang, and D. Tao, “Deep automatic natural image matting,” _arXiv preprint arXiv:2107.07235_ , 2021.
  * [16] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly _et al._ , “An image is worth 16x16 words: Transformers for image recognition at scale,” _arXiv preprint arXiv:2010.11929_ , 2020.
  * [17] H. Touvron, M. Cord, M. Douze, F. Massa, A. Sablayrolles, and H. Jégou, “Training data-efficient image transformers & distillation through attention,” in _International Conference on Machine Learning_. PMLR, 2021, pp. 10 347–10 357.
  * [18] Z. Liu, Y. Lin, Y. Cao, H. Hu, Y. Wei, Z. Zhang, S. Lin, and B. Guo, “Swin transformer: Hierarchical vision transformer using shifted windows,” in _Proceedings of the IEEE/CVF International Conference on Computer Vision_ , 2021, pp. 10 012–10 022.
  * [19] S. Zheng, J. Lu, H. Zhao, X. Zhu, Z. Luo, Y. Wang, Y. Fu, J. Feng, T. Xiang, P. H. Torr, and L. Zhang, “Rethinking Semantic Segmentation from a Sequence-to-Sequence Perspective with Transformers,” in _2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)_. IEEE, pp. 6877–6886.
  * [20] Z. Lu, S. He, X. Zhu, L. Zhang, Y.-Z. Song, and T. Xiang, “Simpler Is Better: Few-Shot Semantic Segmentation With Classifier Weight Transformer,” in _ICCV 2021_ , pp. 8741–8750.
  * [21] N. Carion, F. Massa, G. Synnaeve, N. Usunier, A. Kirillov, and S. Zagoruyko, “End-to-End Object Detection with Transformers,” in _European Conference on Computer Vision_. [Online]. Available: http://arxiv.org/abs/2005.12872
  * [22] J. Yang, C. Li, P. Zhang, X. Dai, B. Xiao, L. Yuan, and J. Gao, “Focal self-attention for local-global interactions in vision transformers,” _arXiv preprint arXiv:2107.00641_ , 2021.
  * [23] Y. Liu, J. Xie, X. Shi, Y. Qiao, Y. Huang, Y. Tang, and X. Yang, “Tripartite information mining and integration for image matting,” in _Proceedings of the IEEE/CVF International Conference on Computer Vision_ , 2021, pp. 7555–7564.
  * [24] Q. Yu, J. Zhang, H. Zhang, Y. Wang, Z. Lin, N. Xu, Y. Bai, and A. Yuille, “Mask guided matting via progressive refinement network,” in _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition_ , 2021, pp. 1154–1163.
  * [25] J. Li, J. Zhang, S. J. Maybank, and D. Tao, “End-to-end animal image matting,” _arXiv e-prints_ , pp. arXiv–2010, 2020.
  * [26] X. Shen, X. Tao, H. Gao, C. Zhou, and J. Jia, “Deep automatic portrait matting,” in _European conference on computer vision_. Springer, 2016, pp. 92–107.
  * [27] H. Cai, F. Xue, L. Xu, and L. Guo, “Transmatting: Enhancing transparent objects matting with transformers,” in _European Conference on Computer Vision_. Springer, 2022, pp. 253–269.
  * [28] L. Grady, T. Schiwietz, S. Aharon, and R. Westermann, “Random walks for interactive alpha-matting,” in _Proceedings of VIIP_ , vol. 2005, 2005, pp. 423–429.
  * [29] J. Tang, Y. Aksoy, C. Oztireli, M. Gross, and T. O. Aydin, “Learning-based sampling for natural image matting,” in _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition_ , 2019, pp. 3055–3063.
  * [30] Y. Sun, C.-K. Tang, and Y.-W. Tai, “Semantic image matting,” in _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition_ , 2021, pp. 11 120–11 129.
  * [31] Q. Chen, T. Ge, Y. Xu, Z. Zhang, X. Yang, and K. Gai, “Semantic human matting,” in _Proceedings of the 26th ACM international conference on Multimedia_ , 2018, pp. 618–626.
  * [32] X. Yang, K. Xu, S. Chen, S. He, B. Y. Yin, and R. Lau, “Active matting,” _Advances in Neural Information Processing Systems_ , vol. 31, 2018.
  * [33] Y. Qiao, Y. Liu, Q. Zhu, X. Yang, Y. Wang, Q. Zhang, and X. Wei, “Multi-scale information assembly for image matting,” in _Computer Graphics Forum_ , vol. 39, no. 7. Wiley Online Library, 2020, pp. 565–574.
  * [34] X. Yang, Y. Qiao, S. Chen, S. He, B. Yin, Q. Zhang, X. Wei, and R. W. Lau, “Smart scribbles for image matting,” _ACM Transactions on Multimedia Computing, Communications, and Applications (TOMM)_ , vol. 16, no. 4, pp. 1–21, 2020.
  * [35] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin, “Attention is all you need,” _Advances in neural information processing systems_ , vol. 30, 2017.
  * [36] W. Wang, E. Xie, X. Li, D.-P. Fan, K. Song, D. Liang, T. Lu, P. Luo, and L. Shao, “Pyramid vision transformer: A versatile backbone for dense prediction without convolutions,” in _Proceedings of the IEEE/CVF International Conference on Computer Vision_ , 2021, pp. 568–578.
  * [37] W. Wang, L. Yao, L. Chen, D. Cai, X. He, and W. Liu, “Crossformer: A versatile vision transformer based on cross-scale attention,” _arXiv e-prints_ , pp. arXiv–2108, 2021.
  * [38] Z. Pan, B. Zhuang, J. Liu, H. He, and J. Cai, “Scalable visual transformers with hierarchical pooling,” _arXiv e-prints_ , pp. arXiv–2103, 2021.
  * [39] Y. Yuan, R. Fu, L. Huang, W. Lin, C. Zhang, X. Chen, and J. Wang, “Hrformer: High-resolution transformer for dense prediction,” _arXiv preprint arXiv:2110.09408_ , 2021.
  * [40] Y. Li, K. Zhang, J. Cao, R. Timofte, and L. Van Gool, “Localvit: Bringing locality to vision transformers,” _arXiv preprint arXiv:2104.05707_ , 2021\.
  * [41] K. Han, A. Xiao, E. Wu, J. Guo, C. Xu, and Y. Wang, “Transformer in transformer,” _Advances in Neural Information Processing Systems_ , vol. 34, 2021.
  * [42] Y. Qiao, Y. Liu, X. Yang, D. Zhou, M. Xu, Q. Zhang, and X. Wei, “Attention-guided hierarchical structure aggregation for image matting,” in _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition_ , 2020, pp. 13 676–13 685.
  * [43] H. Yu, N. Xu, Z. Huang, Y. Zhou, and H. Shi, “High-resolution deep image matting,” _arXiv preprint arXiv:2009.06613_ , 2020.
  * [44] S. Cai, X. Zhang, H. Fan, H. Huang, J. Liu, J. Liu, J. Liu, J. Wang, and J. Sun, “Disentangled image matting,” in _Proceedings of the IEEE/CVF International Conference on Computer Vision_ , 2019, pp. 8819–8828.
  * [45] Q. Hou and F. Liu, “Context-aware image matting for simultaneous foreground and alpha estimation,” in _Proceedings of the IEEE/CVF International Conference on Computer Vision_ , 2019, pp. 4130–4139.
  * [46] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick, “Microsoft coco: Common objects in context,” in _European conference on computer vision_. Springer, 2014, pp. 740–755.
  * [47] M. Everingham, L. Van Gool, C. K. Williams, J. Winn, and A. Zisserman, “The pascal visual object classes (voc) challenge,” _International journal of computer vision_ , vol. 88, no. 2, pp. 303–338, 2010.
  * [48] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga _et al._ , “Pytorch: An imperative style, high-performance deep learning library,” _Advances in neural information processing systems_ , vol. 32, 2019.
  * [49] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei, “Imagenet: A large-scale hierarchical image database,” in _2009 IEEE conference on computer vision and pattern recognition_. Ieee, 2009, pp. 248–255.
  * [50] I. Loshchilov and F. Hutter, “Sgdr: Stochastic gradient descent with warm restarts,” _arXiv preprint arXiv:1608.03983_ , 2016.
  * [51] S. Lutz, K. Amplianitis, and A. Smolic, “Alphagan: Generative adversarial networks for natural image matting,” _arXiv preprint arXiv:1807.10088_ , 2018\.
  * [52] M. Forte and F. Pitié, “$f$, $b$, alpha matting,” _arXiv preprint arXiv:2003.07711_ , 2020.
  * [53] Y. Dai, H. Lu, and C. Shen, “Learning affinity-aware upsampling for deep image matting,” in _Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition_ , 2021, pp. 6841–6850.


  *

# A pedagogical revisit on the hydrogen atom induced by a uniform static
electric field

Tran Duong Anh-Tai1111Present address: Quantum Systems Unit, Okinawa Insitute
of Science and Technology Graduate University, Onna, Okinawa 904-0495, Japan.
Email<EMAIL_ADDRESS>Le Minh Khang1, Nguyen Duy Vy2,3222Email:
<EMAIL_ADDRESS>Thu D. H. Truong1 , and Vinh N. T.
Pham1,4333Coresponding author. Email<EMAIL_ADDRESS>1Department of
Physics, Ho Chi Minh City University of Education, Ho Chi Minh City, Vietnam
2Laboratory of Applied Physics, Science and Technology Advanced Institute, Van
Lang University, Ho Chi Minh City, Vietnam  3Faculty of Applied Technology,
School of Engineering and Technology, Van Lang University, Ho Chi Minh City,
Vietnam  4Postgraduate Studies Office, Ho Chi Minh City University of
Education, Ho Chi Minh City, Vietnam

###### Abstract

In this article, we pedagogically revisit the Stark effect of hydrogen atom
induced by a uniform static electric field. In particular, a general formula
for the integral of associated Laguerre polynomials was derived by applying
the method for Hermite polynomials of degree n proposed in the work [Anh-Tai
T.D. et al., 2021 AIP Advances 11 085310]. The quadratic Stark effect is
obtained by applying this formula and the time-independent non-degenerate
perturbation theory to hydrogen. Using the Siegert State method, numerical
calculations are performed and serve as data for benchmarking. The comparisons
are then illustrated for the ground and some highly excited states to provide
an insightful look at the applicable limit and precision of the quadratic
Stark effect formula for other atoms with comparable properties.

††: Eur. J. Phys.

Keywords: hydrogen atom, Stark effect, perturbation theory.

##  1 Introduction

Atomic/molecular ionization is one of the most fundamental quantum mechanical
phenomena and a comprehensive understanding of its mechanism could have
implications for a variety of physics topics. In the last three decades,
strong-electric-field ionization of atoms and molecules has attracted a great
deal of experimental and theoretical interest due to its abundance of non-
linear physical processes, such as high-harmonic generation (HHG) [1, 2, 3]
and non-sequential double ionization (NSDI) [4, 5, 6, 7, 8]. In the presence
of a weak electric field, the spectral levels of atomic bound states are
typically divided and shifted, resulting in the well-known Stark effect—the
effect named after Johannes Stark, who discovered it in 1913 [9, 10, 11]. P.
Epstein introduced the first satisfactory theoretical explanation of this
effect using the old quantum mechanics [12]. Subsequently, E. Schrödinger also
provided an explanation for the hydrogen Stark effect as a part of the
formalism of wave mechanics [13]. P. Epstein independently revisited the
problem using wave mechanics [14]. It is noteworthy to note that Epstein
solved the problem using parabolic coordinates, which have more advantages
than spherical coordinates and are widely employed in the study of strong-
field ionization of atoms and molecules [15, 16, 17, 18, 19]. Various
approaches, including the WKB [20, 21], group theory [22], hypervirial
relations [23], numerical methods [24, 25, 26, 27], Bender-Wu asymptotic
formula [28], classical viewpoint [29], and a generalization to arbitrarily
high-order perturbed corrections [30, 31, 32], have revisited the problem.
Intriguingly, experimental imaging of the nodal structure of hydrogen Stark
states has recently revealed a significant finding [33]. Consequently, it is
evident that the Stark effect and the hydrogen atom continue to play vital
roles in modern physics.

The perturbation theory is a fundamental and essential approximation method in
quantum mechanics and is a typical pedagogical topic in standard quantum
mechanics textbooks [34, 35, 36, 37, 38, 39, 40, 41]. Since the calculation is
simple enough, the derivation of the Stark effect of the hydrogen atom with
the second-order correction, also known as the quadratic Stark effect, would
be an outstanding pedagogical illustration for perturbation theory at the
undergraduate level. In order for the perturbation theory to be legitimate,
the applied electric field potential must be sufficiently small, resulting in
a weak electric-field strength. Nonetheless, we discover that defining a weak
electric field is not trivial. In early experiments [42, 43, 44], for
instance, field strengths on the order of $10^{-7}$–$10^{-6}$ were considered
strong; however, in more recent experiments [33, 45, 46], a field strength of
$0.1$ a.u. is regarded as weak. To the best of our knowledge, the applicable
interval for the approximation of the formula characterizing the Stark effect
of hydrogen derived from perturbation theory has not yet been thoroughly
investigated. Consequently, it is essential to revisit the Stark effect of
atomic hydrogen from a pedagogical perspective and also consider the remaining
issues discussed previously.

Our primary objective is to present a mathematically rigorous and
straightforward method for approximating the eigenvalues of a hydrogen atom
induced by a uniform static electric field as a pedagogical illustration of
using advanced one-variable calculus to solve fundamental quantum mechanics
problems for undergraduates. Quantum mechanics is related to perturbation
theory and the non-relativistic hydrogen atom in parabolic coordinates, while
advanced one-variable calculus is represented by the integral of associated
Laguerre polynomials. In our method, the operators are expressed in parabolic
coordinates, which are efficient and widely-utilized for atomic ionization
studies. Using the parabolic coordinates effectively reduces the number of
analytical calculations, as the integrals of the associated Laguerre
polynomials can be calculated using the general formula. Moreover, by
performing numerical calculations based on the Siegert State (SS) method [15,
16, 17], we also address the issue of evaluating the exactness and the range
of field strength such that the approximated formula continues to accurately
characterize the dependence of the eigenvalues on the field strength. The
comparisons are illustrated for the ground state and some highly-excited
states with the principal quantum number up to $n=10$.

The article’s structure is as follows. In Section 2, the general formula for
the integral of associated Laguerre polynomials is derived in detail. In
Section 3, we present the derivation of the formula characterizing the
quadratic Stark effect of hydrogen as a pedagogical application of using
advanced one-variable calculus to solve quantum mechanical problems, as well
as comparisons of the approximate formula and numerical calculations. The
conclusion is presented in Section 4. This article employs the atomic units in
which $\hbar=m_{e}=e=1$ for the sake of simplification. $X^{(n)}$ denotes the
$n$th-order perturbative correction to the physical quantity $X$.

##  2 Derivation of the general formula for the integral of associated
Laguerre polynomials

Following the procedure proposed in Ref. [47] to deduce the general formula
for integrals of Hermite polynomials, this section derives the general formula
for the integral of the associated Laguerre polynomials, which is given by

$Z(\alpha,k,k^{\prime})=\int\limits_{0}^{\infty}x^{\alpha}u_{k,m}\left(x\right)u_{k^{\prime},m}\left(x\right)dx,$
(1)

where

$u_{k,m}\left(x\right)=x^{m/2}\exp(-x/2)L_{k}^{m}(x),$ (2)

with $L_{k}^{m}(x)$ and $\alpha$ are the associated Laguerre polynomial and
non-negative integer, respectively. The two associated Laguerre polynomials in
Eq. (1) are then expanded by the generating function [48] as shown:

$\displaystyle U(x,t)$
$\displaystyle=\sum\limits_{k=0}^{\infty}L_{k}^{m}(x)t^{k}=\dfrac{1}{(1-t)^{m+1}}\exp\left(-\dfrac{xt}{1-t}\right),$
(3) $\displaystyle V(x,y)$
$\displaystyle=\sum\limits_{k^{\prime}=0}^{\infty}L_{k^{\prime}}^{m}(x)y^{k^{\prime}}=\dfrac{1}{(1-y)^{m+1}}\exp\left(-\dfrac{xy}{1-y}\right),$
(4)

where $|t|<1$, and $|y|<1$. Multiplying Eqs. (3) and (4) side by side and by
$x^{m+\alpha}\exp(-x)$, then taking the integral from 0 to $\infty$, we get

$\sum\limits_{k=0}^{\infty}\sum\limits_{k^{\prime}=0}^{\infty}\left[\int\limits_{0}^{\infty}x^{m+\alpha}\exp(-x)L_{k}^{m}(x)L_{k^{\prime}}^{m}(x)dx\right]t^{k}y^{k^{\prime}}=\\\
\dfrac{1}{(1-t)^{m+1}(1-y)^{m+1}}\int\limits_{0}^{\infty}x^{m+\alpha}\exp\left[-x\left(1+\dfrac{t}{1-t}+\dfrac{y}{1-y}\right)\right]dx.$
(5)

The result of the integral on the right hand side (RHS) of Eq. (5) can be
straightforwardly obtained,

$I=\int\limits_{0}^{\infty}x^{m+\alpha}\exp\left[-x\left(1+\dfrac{t}{1-t}+\dfrac{y}{1-y}\right)\right]dx=\dfrac{(m+\alpha)!(1-t)^{m+\alpha+1}(1-y)^{m+\alpha+1}}{(1-ty)^{m+\alpha+1}},$
(6)

by applying the integral
$\int\limits_{0}^{\infty}x^{n}\exp(-px)dx=\dfrac{n!}{p^{n+1}}.$ Substituting
Eq. (6) back into the RHS of Eq. (5), we obtain

$RHS=\dfrac{(m+\alpha)!(1-t)^{\alpha}(1-y)^{\alpha}}{(1-ty)^{m+\alpha+1}}.$
(7)

The binomials in Eq. (7) are then expanded as

$\displaystyle(1-ty)^{-(m+\alpha+1)}$
$\displaystyle=\sum\limits_{s=0}^{\infty}{m+s+\alpha\choose s}(ty)^{s},$ (8)
$\displaystyle(1-t)^{\alpha}(1-y)^{\alpha}$
$\displaystyle=\sum\limits_{i=0}^{\alpha}\sum\limits_{j=0}^{\alpha}(-1)^{i+j}{\alpha\choose
i}{\alpha\choose j}t^{i}y^{j}.$ (9)

Hence, the RHS can be rewritten as

$RHS=\sum_{s=0}^{\infty}\sum_{i=0}^{\alpha}\sum_{j=0}^{\alpha}(-1)^{i+j}{\alpha\choose
i}{\alpha\choose j}{m+s+\alpha\choose s}t^{s+i}y^{s+j}.$ (10)

The value of $Z(\alpha,k,k^{\prime})$ is obviously the coefficient of
$t^{s+i}y^{s+j}$ and can therefore be determined by unifying the coefficients
of $t^{s+i}y^{s+j}$ from both sides of Eq. (5). We acquire

$\begin{cases}s+i=k\\\ s+j=k^{\prime}\end{cases}\Rightarrow k^{\prime}=k-i+j.$
(11)

Consequently, the desired formula for the general integral of the associated
Laguerre polynomials is attained

$Z(\alpha,k,k^{\prime})=\sum\limits_{i=0}^{\alpha}\sum\limits_{j=0}^{\alpha}(-1)^{i+j}{\alpha\choose
i}{\alpha\choose j}\dfrac{(m+\alpha+k-i)!}{(k-i)!}\delta_{k^{\prime},k-i+j}.$
(12)

$Z(\alpha,k,k^{\prime})$ is non-zero if, for a given set of $\alpha$ and $k$,
only $k^{\prime}$ satisfies the selection rule determined by the Kronecker
delta, $\delta_{k^{\prime},k-i+j}$. To illustrate the application of the
general formula Eq. (12), we take the known integral [48]

$I_{1}=\int\limits_{0}^{\infty}u_{k,m}(x)u_{k^{\prime},m}(x)dx=\int\limits_{0}^{\infty}x^{m}\exp(-x)L_{k}^{m}(x)L_{k^{\prime}}^{m}(x)dx=\dfrac{(k+m)!}{k!}\delta_{k^{\prime},k},$
(13)

as an illustration. One can readily observe that the integral $I_{1}$ is
equivalent to the case where $\alpha=0$ and that the indices $i=j=0$.
Substituting $\alpha=i=j=0$ back into Eq. (12) yields

$Z(0,k,k^{\prime})=(-1)^{0+0}{0\choose 0}{0\choose
0}\dfrac{(m+0+k-0)!}{(k-0)!}\delta_{k^{\prime},k-0+0}=\dfrac{(k+m)!}{k!}\delta_{k^{\prime},k}.$
(14)

The well-known integral [48]

$I_{2}=\int\limits_{0}^{\infty}x^{m+1}\exp(-x)L_{k}^{m}(x)L_{k^{\prime}}^{m}(x)dx=\dfrac{(k+m)!}{k!}(2k+m+1)\delta_{k^{\prime},k},$
(15)

will be left as an exercise, and we encourage readers to derive the result in
Eq. (15) on their own.

##  3 Results and discussion

Following are the eigenvalues of the Hamiltonian describing non-relativistic
hydrogen induced by a uniform z-axis directed static electric field

$\displaystyle\widehat{H}=-\dfrac{1}{2}\Delta-\frac{1}{r}+Fz,$ (16)

is discussed. Here

$\displaystyle\widehat{H}_{0}=-\dfrac{1}{2}\Delta-\frac{1}{r},$ (17)

is the Hamiltonian characterizing the non-relativistic hydrogen atom in the
Coulomb field, and $Fz$ is the potential resulting from the uniform static
electric field with the strength $F\geq 0$. Here, $r$ and $z$ represent the
distance and $z$-axis displacement of the electron from the proton, which is
assumed to be at the origin of the coordinate system, respectively. In the
parabolic coordinates, the three-dimensional Laplacian operator, $\Delta$, is
given by

$\Delta=\dfrac{4}{\xi+\eta}\dfrac{\partial}{\partial\xi}\left(\xi\dfrac{\partial}{\partial\xi}\right)+\dfrac{4}{\xi+\eta}\dfrac{\partial}{\partial\eta}\left(\eta\dfrac{\partial}{\partial\eta}\right)+\dfrac{4}{\xi\eta}\dfrac{\partial^{2}}{\partial\varphi^{2}},$
(18)

where ($\xi,\eta,\varphi$) corresponds to the $\xi$ distance, the $\eta$
distance, and the azimuthal angle, respectively. The parabolic coordinates are
connected to the spherical coordinates via the transformation

$\xi=r+z\left(0\leq\xi<+\infty\right),\eta=r-z\left(0\leq\eta<+\infty\right),\varphi\left(0\leq\varphi\leq
2\pi\right),$ (19)

and the Jacobian of the transformation of coordinates is given by

$|J|=\dfrac{\xi+\eta}{4}.$ (20)

The general Hamiltonian Eq.(16) reduces to $\widehat{H}_{0}$ whose bound-state
eigenvalues and eigenfunctions are already known in the absence of an electric
field. Since the analytical derivation of the eigenvalues and eigenfunctions
of the hydrogen atom in parabolic coordinates has been rigorously presented in
Refs. [49, 35, 34], we briefly present the necessary results for the
derivation of the hydrogen quadratic Stark effect formula in the following.
The bound-state eigenvalues are given as

$E^{(0)}=-\dfrac{1}{2n^{2}},$ (21)

where $n$ is the principal quantum number. The parabolic coordinates enable us
to express the bound-state eigenfunctions of $\widehat{H}_{0}$ as

$\psi^{(0)}_{n_{1},n_{2},m}(\xi,\eta,\varphi)=Au_{n_{1},m}\left(\xi/n\right)u_{n_{2},m}\left(\eta/n\right)\exp(im\varphi),$
(22)

with

$A=\dfrac{1}{n^{2}}\sqrt{\dfrac{n_{1}!n_{2}!}{\pi(n_{1}+m)!(n_{2}+m)!}},$ (23)

is the normalization factor. In parabolic coordinates, a bound state of the
hydrogen atom is denoted by a set of three quantum numbers $(n_{1},n_{2},m)$,
where $n_{1}$ and $n_{2}$ represent the parabolic quantum numbers describing
the $\xi$ and $\eta$ variables, respectively, and $m$ is the magnetic quantum
number. Note that in the calculations that follow, the magnetic quantum number
should be positive because the eigenfunctions
$\psi^{(0)}_{n_{1},n_{2},m}(\xi,\eta,\varphi)$ with $\pm m$ are degenerate, as
is evident from Eq. (22). The relationship between the three quantum numbers
$(n_{1},n_{2},m)$ and the principal quantum number $n$ is as

$n=n_{1}+n_{2}+m+1.$ (24)

The functions $u_{n_{1},m}(\xi/n)$ and $u_{n_{2},m}(\eta/n)$, which
independently describe the dependence of eigenfunctions along $\xi$ and $\eta$
coordinates, have the identical form given by

$u_{k,m}\left(x\right)=x^{m/2}\exp\left(-x/2\right)L_{k}^{m}\left(x\right),$
(25)

where $L_{k}^{m}(x)$ is the associated Laguerre polynomials. Physically, the
parabolic quantum number $k=\\{n_{1},n_{2}\\}$ determines the number of
$u_{k,m}\left(x\right)$ nodes, whereas the magnetic quantum number $m$ is
associated with the boundary condition at $x=0$. For $m=0$,
$u_{k,0}\left(0\right)$ decays from 1, whereas $u_{k,m\neq 0}\left(0\right)=0$
for $m\neq 0$. This characteristic is evident in Fig. 1, which depicts the
absolute squared of $u_{k,m}\left(x\right)$ for various values $(k,m)$.

Figure 1: The absolute squared of $u_{k,m}\left(x\right)$ for three sets of
$(k,m)$. Note that in the plot
$\int\limits_{0}^{\infty}|u_{k,m}\left(x\right)|^{2}dx=1$.

In the presence of the electric field, the Hamiltonian (16) eigenvalues cannot
be determined analytically. Consequently, the time-independent non-degenerate
perturbation theory is utilized to approximate the required eigenvalues. In
this method, it is assumed that the uniform static electric field is
sufficiently weak, so that the potential caused by such a field can be
regarded as a minor perturbation. In the present study, the eigenvalues of the
Hamiltonian (16) are expanded up to the second order of the electric field
strength

$E=E^{(0)}+E^{(1)}F+E^{(2)}F^{2}+\mathcal{O}(F^{3}).$ (26)

Here $E^{(0)}$, $E^{(1)}$ and $E^{(2)}$ are the zero-, first- and second-order
corrections to the eigenvalues, respectively. $E^{(0)}$ coincides to the
eigenvalues of hydrogen atom in the Coulomb field given by Eq. (21). $E^{(1)}$
and $E^{(2)}$ are then determined by the time-independent non-degenerate
perturbation theory. $E^{(1)}$ is obtained by evaluating

$\displaystyle E^{(1)}$
$\displaystyle=\langle\psi^{(0)}_{n_{1},n_{2},m}|\dfrac{\xi-\eta}{2}|\psi^{(0)}_{n_{1},n_{2},m}\rangle$
$\displaystyle=2\pi
A^{2}\int\limits_{0}^{\infty}\int\limits_{0}^{\infty}u^{*}_{n_{1},m}\left(\xi/n\right)u^{*}_{n_{2},m}\left(\eta/n\right)\dfrac{\xi-\eta}{2}u_{n_{1},m}\left(\xi/n\right)u_{n_{2},m}\left(\eta/n\right)|J|d\xi
d\eta,$ (27)

where $u^{*}_{k,m}\left(x\right)=u_{k,m}\left(x\right)$ denotes the complex
conjugate of $u_{k,m}\left(x\right)$. Note that in the following, the results
of the integrations over $\xi$ and $\eta$ will be automatically multiplied by
the factor $2\pi$ because the integration over the azimuthal variable,
$\varphi$, always yields the factor $2\pi$.

Substituting the Jacobian given by Eq. (20) into Eq. (3) yields

$E^{(1)}=E_{1}^{(1)}-E_{2}^{(1)}$ (28)

with

$\displaystyle E_{1}^{(1)}=\dfrac{\pi
n^{2}A^{2}}{4}\int\limits_{0}^{\infty}\left(\xi/n\right)^{2}u^{2}_{n_{1},m}\left(\xi/n\right)d\left(\xi/n\right)\int\limits_{0}^{\infty}u^{2}_{n_{2},m}\left(\eta/n\right)d\left(\eta/n\right),$
(29) $\displaystyle E_{2}^{(1)}=\dfrac{\pi
n^{2}A^{2}}{4}\int\limits_{0}^{\infty}\left(\eta/n\right)^{2}u^{2}_{n_{2},m}\left(\eta/n\right)d\left(\eta/n\right)\int\limits_{0}^{\infty}{u^{2}_{n_{1},m}}\left(\xi/n\right)d\left(\xi/n\right).$
(30)

Obviously, the integrals $E_{1}^{(1)}$, and $E_{2}^{(1)}$ can be rewritten in
an unified form as

$\displaystyle I_{k,\ell}=\dfrac{\pi
n^{2}A^{2}}{4}\int\limits_{0}^{\infty}x^{2}u^{2}_{k,m}(x)dx\int\limits_{0}^{\infty}u^{2}_{\ell,m}(y)dy.$
(31)

The integral $I_{k,\ell}$ can be evaluated by using the Eq. (12), hence we get

$\displaystyle
E_{1}^{(1)}=I_{n_{1},n_{2}}=\dfrac{1}{4}\left(6n_{1}^{2}+6n_{1}m+6n_{1}+m^{2}+3m+2\right),$
(32) $\displaystyle
E_{2}^{(1)}=I_{n_{2},n_{1}}=\dfrac{1}{4}\left(6n_{2}^{2}+6n_{2}m+6n_{2}+m^{2}+3m+2\right).$
(33)

Plugging Eqs. (32) and (33) to Eq. (28), we obtain

$E^{(1)}=\dfrac{3}{2}n(n_{1}-n_{2}).$ (34)

With this first-order correction, the formula describing the eigenvalues’
dependence on the electric field strength is given as

$E=-\dfrac{1}{2n^{2}}+\dfrac{3}{2}n(n_{1}-n_{2})F+\mathcal{O}(F^{2}).$ (35)

The Stark effect described by Eq. (35) is called the linear Stark effect since
the splitting of the energy levels is

$\Delta E^{(1)}=\dfrac{3}{2}n(n_{1}-n_{2})F\propto F.$ (36)

Moreover, substates with identical parabolic quantum numbers, $n_{1}=n_{2}$,
do not perceive the applied electric field with the first-order field-induced
correction because their distribution of the electrical charge between the
$\xi$ and $\eta$ coordinates is symmetric, whereas the linear Stark effect
derives from the asymmetric distribution of the electrical charge [35, 34].

The second-order correction to the eigenvalues can be computed as follows,

$E^{(2)}=\langle\psi^{(0)}_{n_{1},n_{2},m}|\dfrac{\xi-\eta}{2}|\psi^{(1)}_{n_{1},n_{2},m}\rangle$
(37)

where $|\psi^{(1)}_{n_{1},n_{2},m}\rangle$ is the first-order correction to
the eigenfunctions which could be found in Ref [50] and reads as

$\psi^{(1)}_{n_{1},n_{2},m}(\xi,\eta,\varphi)=\dfrac{n^{3}A}{4}\left[\Phi_{n_{1},m}\left(\xi/n\right)u_{n_{2},m}\left(\eta/n\right)-u_{n_{1},m}\left(\xi/n\right)\Phi_{n_{2},m}\left(\eta/n\right)\right]\exp(im\varphi),$
(38)

in which

$\Phi_{k,m}(x)=\dfrac{(k+m)(k+m-1)}{2}u_{k-2,m}(x)-(3n-m-3-2n_{1})(k+m)u_{k-1,m}(x)+\\\
+3ku_{k,m}(x)-(3n-m+1-2n_{1})(k+1)u_{k+1,m}(x)+\dfrac{(k+1)(k+2)}{2}u_{k+2,m}(x).$
(39)

Combining Eqs. (22), (39), and (38) again yields

$\displaystyle E^{(2)}=E_{1}^{(2)}+E_{2}^{(2)},$ (40)

where the two integrals $E_{1}^{(2)}$ and $E_{2}^{(2)}$ have an unified form
as

$K_{i,j}=\dfrac{\pi
n^{7}A^{2}}{16}\left\\{\int\limits_{0}^{\infty}x^{2}\Phi_{i,m}\left(x\right)u_{i,m}\left(x\right)dx\int\limits_{0}^{\infty}u_{j,m}\left(y\right)u_{j,m}\left(y\right)dy\right.+\\\
\left.-\int\limits_{0}^{\infty}x^{2}u_{i,m}\left(x\right)u_{i,m}\left(x\right)dx\int\limits_{0}^{\infty}\Phi_{j,m}\left(y\right)u_{j,m}\left(y\right)dy\right\\}.$
(41)

Again, the integral $K_{i,j}$ can be evaluated and derived with the help of
Eq. (12)

$\displaystyle K_{i,j}=$
$\displaystyle\dfrac{n^{3}}{16}\left[4i(i^{2}-1)+6i(i+im+m^{2}+m-1)\right.+$
$\displaystyle\left.+(m^{2}+3m+2)(3i-3j+2m-3)+18(i^{2}+im+i)(i-j-2n)\right].$
(42)

Substituting $E^{(2)}_{1}=K_{n_{1},n_{2}}$ and $E^{(2)}_{2}=K_{n_{2},n_{1}}$
into Eq. (40) yields the second-order correction to the eigenvalues as

$E^{(2)}=-\dfrac{n^{4}}{16}\left[17n^{2}-3(n_{1}-n_{2})^{2}-9m^{2}+19\right].$
(43)

Consequently, the formula that describes the so-called quadratic Stark effect
is obtained

$E=-\dfrac{1}{2n^{2}}+\dfrac{3n(n_{1}-n_{2})}{2}F-\dfrac{n^{4}}{16}\left[17n^{2}-3(n_{1}-n_{2})^{2}-9m^{2}+19\right]F^{2}+\mathcal{O}(F^{3}).$
(44)

In contrast to the linear Stark effect, the quadratic Stark effect involves
the splitting of energy levels

$\Delta
E^{(2)}=\dfrac{3n(n_{1}-n_{2})}{2}F-\dfrac{n^{4}}{16}\left[17n^{2}-3(n_{1}-n_{2})^{2}-9m^{2}+19\right]F^{2},$
(45)

exists even when the electrical charge distribution is symmetric,
$n_{1}=n_{2}$. This indicates that the substates are always able to detect the
presence of the applied electric field, despite its weakness. When the
hydrogen atom is exposed to a uniform static electric field, the degeneracy of
substates with the same principal quantum number $n$ is completely eliminated
[34, 35].

Using the Siegert State (SS) method, we explicitly verify the exactness and
applicability of the approximated formula given by the equation (44) using
numerical calculations. Thus, we compute the relative deviation specified by

$\sigma=\left|\dfrac{E_{ana}-E_{num}}{E_{num}}\right|\times 100\%,$ (46)

where $E_{num}$ and $E_{ana}$ represent the results of numerical and
analytical methods, respectively. Figure 2 illustrates explicitly the
evaluation for the ground state and the first excited state with three
substates of hydrogen induced by a uniform static electric field. For the
ground state, it can be observed that in the regime $0\leq F\leq 0.5$ a.u.,
the results obtained by the approximated formula and numerical calculation are
well-matched, and the relative error is close to $0$. The discrepancy between
two approaches increases as the electric-field strength increases; however, it
is still less than $1\%$ at $F=0.1$ a.u. In Figs.2(c-d), the three substates
of the first excited state exhibit the same characteristic. When $F=0.01$
a.u., the $(0,1,0)$ substate has the maximum relative deviation, below $2\%$,
while the $(1,0,0)$ substate has the smallest relative error, approximately
$0.5\%$.

Figure 2: The first column illustrates the dependence of the eigenvalue, $E$,
on the external field strength, $F$ for the ground state and the first excited
state of the hydrogen atom induced by a static electric field. In the second
column, the relative errors between the numerical result obtained by the
Siegert State method and the approximated formula are displayed. Note that the
solid line represents the numerical results, whereas the squares represent the
approximations.

Figure 3 displays the comparison for the excited states with the principle
quantum number $n=\\{4,6,8,10\\}$. In these instances, relative deviations are
less than $3.5\%$, which is still an acceptable value.

Figure 3: Same as Fig. 2 for a) $n=4$, b) $n=6$, c) $n=8$, and d) $n=10$.

##  4 Conclusion

In conclusion, we have revisited the quadratic Stark effect of hydrogen for
educational purposes. Our method relies on the time-independent non-degenerate
perturbation theory and the general integral formula for associated Laguerre
polynomials. We have also investigated the applicability interval of the
approximated formula describing the quadratic Stark effect of hydrogen using a
numerical technique based on the Siegert State method. The comparison
demonstrates that when the applied electric field is suitably weak, the
approximated formula agrees well with numerical calculations not only for the
ground state, but also for highly excited states as well. The approximated
formula can therefore be used to predict the eigenvalues of highly excited
states in the presence of an exceedingly weak electric field for future high-
precision numerical calculations. In addition, we wish to emphasize that, in
quantum mechanics, perturbation theory is uncomplicated but never trivial. To
address the problem of a stronger electric field, it should be noted that
higher-order corrections or improved approaches should be considered; however,
these are not our pedagogical objectives. In conclusion, we anticipate that
the results of this study will serve as a valuable resource for undergraduates
studying quantum mechanics and be readily accessible to them.

This work is supported by the Ministry of Education and Training of Vietnam
under grant number B2021-SPS-02-VL. N.D. Vy is thankful to the Van Lang
University.

## References

## References

  * [1] Chelkowski S, Bandrauk A D and Corkum P B 1990 Physical Review Letters 65 2355
  * [2] Lewenstein M, Balcou P, Ivanov M Y, L’huillier A and Corkum P B 1994 Physical Review A 49 2117
  * [3] Winterfeldt C, Spielmann C and Gerber G 2008 Reviews of Modern Physics 80 117
  * [4] Suran V and Zapesochny I 1975 Sov. Tech. Phys. Lett 1 2
  * [5] Rudenko A, De Jesus V, Ergler T, Zrost K, Feuerstein B, Schröter C, Moshammer R and Ullrich J 2007 Physical Review Letters 99 263003
  * [6] Bergues B, Kübel M, Johnson N G, Fischer B, Camus N, Betsch K J, Herrwerth O, Senftleben A, Sayler A M, Rathje T et al. 2012 Nature Communications 3 1–6
  * [7] Staudte A, Ruiz C, Schöffler M, Schössler S, Zeidler D, Weber T, Meckel M, Villeneuve D, Corkum P, Becker A et al. 2007 Physical Review Letters 99 263002
  * [8] Truong T D, Nguyen H H, Le H B, Tran H M, Vy N D, Anh-Tai T D, Pham V N et al. 2022 Computer Physics Communications 276 108372
  * [9] Stark J 1913 Nature 92 401–401
  * [10] Stark J 1914 Annalen der Physik 348 965–982
  * [11] Stark J and Wendt G 1914 Annalen der Physik 348 983–990
  * [12] Epstein P S 1916 Annalen der Physik 355 489–520
  * [13] Schrödinger E 1926 Annalen der physik 385 437–490
  * [14] Epstein P 1926 Physical Review 28 695
  * [15] Batishchev P A, Tolstikhin O I and Morishita T 2010 Physical Review A 82 023416
  * [16] Pham V, Tolstikhin O and Morishita T 2014 Physical Review A 89 033426
  * [17] Ohgoda S, Tolstikhin O I and Morishita T 2017 Physical Review A 95 043417
  * [18] Trinh V H, Pham V N, Tolstikhin O I and Morishita T 2015 Physical Review A 91 063410
  * [19] Pham V N, Tolstikhin O I and Morishita T 2019 Physical Review A 99 013428
  * [20] Wentzel G 1926 Zeitschrift für Physik A Hadrons and Nuclei 38 518–529
  * [21] Bekenstein J and Krieger J 1969 Physical Review 188 130
  * [22] Alliluev S and Malkin I 1974 Zhurnal Ehksperimental’noj i Teoreticheskoj Fiziki 66 1283–1294
  * [23] Lai C 1981 Physics Letters A 83 322–325
  * [24] Damburg R J and Kolosov V V 1976 Journal of Physics B: Atomic and Molecular Physics 9 3149
  * [25] Damburg R J and Kolosov V V 1978 J. Phys. B: Atom. Molec. Phys. 11 1921–1930
  * [26] Damburg R J and Kolosov V V 1979 J. Phys. B: Atom. Molec. Phys. 12 2637–2643
  * [27] Damburg R J and Kolosov V V 1981 J. Phys. B. At. Mol. Phys. 14 829–834
  * [28] Benassi L, Grecchi V, Harrell E and Simon B 1979 Physical Review Letters 42 704
  * [29] Hooker Aand Greene C and Clark W 1997 Physical Review A 55 4609
  * [30] Silverstone H 1978 Physical Review A 18 1853
  * [31] Alliluev S, Eletsky V, Popov V and Weinberg V 1980 Physics Letters A 78 43–46
  * [32] Bolgova I, Ovsyannikov V, Pal’chikov V, Magunov A and von Oppen G 2003 Journal of Experimental and Theoretical Physics 96 1006–1018
  * [33] Stodolna A, Rouzée A, Lépine F, Cohen S, Robicheaux F, Gijsbertsen A, Jungmann J, Bordas C and Vrakking M 2013 Physical Review Letters 110 213001
  * [34] Landau L D and Lifshitz E M 1958 Quantum mechanics: non-relativistic theory (Pergamon)
  * [35] Bethe H and Salpeter E 1957 Quantum mechanics of one- and two-electron atoms (Springer)
  * [36] Magnasco V 2006 Elementary methods of molecular quantum mechanics (Elsevier)
  * [37] Schwabl F 2007 Quantum mechanics (Springer Science & Business Media)
  * [38] Shankar R 2012 Principles of quantum mechanics (Springer Science & Business Media)
  * [39] Razavy M 2013 Quantum theory of tunneling (World Scientific)
  * [40] Fernández-Menchero L and Summers H 2013 Physical Review A 88 022509
  * [41] Griffiths D J and Schroeter D F 2018 Introduction to Quantum Mechanics (Cambridge University Press)
  * [42] Rottke H and Welge K 1986 Physical Review A 33 301
  * [43] Glab W L, Ng K, Yao D and Nayfeh M H 1985 Physical Review A 31 3677
  * [44] Glab W L and Nayfeh M H 1985 Physical Review A 31 530
  * [45] Cohen S, Harb M, Ollagnier A, Robicheaux F, Vrakking M, Barillot T, Lepine F and Bordas C 2013 Physical Review Letters 110 183001
  * [46] Cohen S, Harb M, Ollagnier A, Robicheaux F, Vrakking M, Barillot T, Lepine F and Bordas C 2016 Physical Review A 94 013414
  * [47] Anh-Tai T D, Hoang D T, Truong T D, Nguyen C D, Uyen L N, Dung D H, Vy N D and Pham V N 2021 AIP Advances 11 085310
  * [48] Weber H J and Arfken G B 2003 Essential mathematical methods for physicists (Elsevier)
  * [49] Anh-Tai T D and Pham V N 2015 Hue University Journal of Science 107 89–97
  * [50] Kamenski A and Ovsiannikov V 2000 Journal of Physics B: Atomic, Molecular and Optical Physics 33 491