# SSSegmenation: An Open Source Supervised Semantic Segmentation Toolbox Based
on PyTorch

Zhenchao Jin
The University of Hong Kong
<EMAIL_ADDRESS>
###### Abstract

This paper presents SSSegmenation, which is an open source supervised semantic
image segmentation toolbox based on PyTorch. The design of this toolbox is
motivated by MMSegmentation while it is easier to use because of fewer
dependencies and achieves superior segmentation performance under a comparable
training and testing setup. Moreover, the toolbox also provides plenty of
trained weights for popular and contemporary semantic segmentation methods,
including Deeplab, PSPNet, OCRNet, MaskFormer, _etc_. We expect that this
toolbox can contribute to the future development of semantic segmentation.
Codes and model zoos are available at SSSegmenation.

##  1 Introduction

Semantic image segmentation is a task of grouping pixels with different
semantic categories. Prior to SSSegmenation, many efforts have been made to
provide high-quality codebases and unified benchmarks for semantic
segmentation, _e.g._ , MMSegmentation [1], OpenSeg [2] and PyTorch-Encoding
[3]. Despite this, most of the codebases have not been updated for a long time
and thus, lack support for the state-of-the-art segmentation algorithms.
Furthermore, the actively updated MMSegmentation toolbox contains complex
mmlab-series dependencies, which is sometimes unfriendly to the researchers.
To reduce the learning cost of using a segmentation toolbox and provide high-
quality re-implementation of the state-of-the-art segmentation approaches, we
build SSSegmenation, an open source supervised semantic image segmentation
toolbox based on PyTorch [4]. The major features of SSSegmenation can be
summarized as follows,

  * •

High Performance. The performance of re-implemented semantic segmentation
algorithms is better than or comparable to other codebases.

  * •

Unified Benchmark. Like conventional MMSegmentation [1], various segmentation
methods are unified into several specific modules. Benefiting from this
design, SSSegmentation can integrate a great deal of popular and contemporary
semantic segmentation frameworks and then, train and test them on unified
benchmarks.

  * •

Fewer Dependencies. SSSegmenation tries its best to avoid introducing more
dependencies when reproducing novel semantic segmentation approaches.

SSSegmenation project is under active development and, we expect that this
toolbox can facilitate the future development of semantic image segmentation.

##  2 Supported Frameworks

SSSegmenation supports abounding backbone networks (_i.e._ , encoder) and
segmentors (_i.e._ , decoder). The integrated backbone networks and segmentors
in SSSegmenation are listed in this section. Note that, most of the re-
implementation algorithms in SSSegmenation are modified from the released
codes in official repositories or MMSegmentation [1].

###  2.1 Supported Backbone Networks

  * •

UNet [5]. A classic backbone network in medical image segmentation, which is
published in MICCAI 2015.

  * •

BEiT [6]. A self-supervised bidirectional encoder vision representation model
inspired by BERT [7], and it is accepted by ICLR 2022.

  * •

Twins [8]. A variant of vision transformer architectures for visual tasks,
which appears in NeurIPS 2021.

  * •

CGNet [9]. A lightweight and efficient network for semantic segmentation,
which is accepted by TIP 2020.

  * •

HRNet [10]. A high-resolution representation learning network, and it appears
in TPAMI 2020.

  * •

ERFNet [11]. An efficient residual factorized convolution network for real-
time semantic segmentation, which is published in T-ITS 2017.

  * •

ResNet [12]. A classic backbone network in image classification, which is
accepted by CVPR 2016.

  * •

ResNeSt [13]. A split-attention network for visual tasks, which appears in
CVPRW 2022.

  * •

ConvNeXt [14]. A ViT-inspired convolution network, and it is published in CVPR
2022.

  * •

FastSCNN [15]. A fast segmentation convolutional neural network reported in
ArXiv 2019.

  * •

BiSeNetV1 [16]. A real-time bilateral segmentation network, which is accepted
by ECCV 2018.

  * •

BiSeNetV2 [17]. A bilateral network with guided aggregation for real-time
semantic segmentation, which is published in IJCV 2021.

  * •

MobileNetV2 [18]. A widely used lightweight and real-time convolution network
for various visual applications, which is accepted by CVPR 2018.

  * •

MobileNetV3 [19]. A lightweight and real-time convolution network based on a
combination of complementary search techniques as well as a novel architecture
design, which appears in ICCV 2019.

  * •

SwinTransformer [20]. A widely used hierarchical vision transformer
architecture using shifted windows for visual tasks, which is published in
ICCV 2021.

  * •

VisionTransformer [21]. The first vision transformer architecture, which is
accepted by IClR 2021.

###  2.2 Supported Segmentors

  * •

FCN [22]. A conventional encoder-decoder segmentation framework, and it is
published in TPAMI 2017.

  * •

CE2P [23]. A classic human parsing framework, which appears in AAAI 2019.

  * •

SETR [24]. A pure transformer structure (_i.e._ , without convolution and
resolution reduction) to encode an image as a sequence of patches, which is
proposed in CVPR 2021.

  * •

ISNet [25]. A high-performance semantic segmentation framework utilizing
image-level and semantic-level contextual information to augment pixel
representations, which is proposed in ICCV 2021.

  * •

ICNet [26]. An image cascade network that incorporates multi-resolution
branches under proper label guidance to reduce a large portion of computation
for pixel-wise label inference, which is introduced in ECCV 2018.

  * •

CCNet [27]. A criss-cross network for effectively and efficiently obtaining
full-image contextual information, which is accepted by ICCV 2019.

  * •

DANet [28]. A dual attention network to adaptively integrate local features
with their global dependencies, which is published in CVPR 2019.

  * •

DMNet [29]. A dynamic multi-scale neural network to adaptively aggregate
multi-scale contents for predicting pixel-level semantic labels, which is
proposed in ICCV 2019.

  * •

GCNet [30]. A segmentation framework that unifies non-local block [31] and
squeeze-excitation network [32] into a three-step general framework for global
context modeling, which is proposed in TPAMI 2020.

  * •

ISANet [33]. An interlaced sparse self-attention approach to improve the
efficiency of self-attention mechanism for semantic segmentation, which is
accepted by IJCV 2021.

  * •

EncNet [34]. A context encoding module to explore the impact of global
contextual information in semantic segmentation, which is presented in CVPR
2018.

  * •

OCRNet [35]. A semantic segmentation framework that emphasizes utilizing
object-contextual representations to enhance pixel representations, which is
proposed in ECCV 2020.

  * •

DNLNet [36]. A disentangled non-local block to facilitate learning for both
the whitened pairwise term and the unary term in semantic segmentation, which
appears in ECCV 2020.

  * •

ANNNet [37]. An asymmetric non-local neural network (consisting of asymmetric
pyramid non-local block and asymmetric fusion non-local block) for semantic
segmentation, which is accepted by ICCV 2019.

  * •

EMANet [38]. An expectation-maximization attention module for aggregating
contextual information in a robust way, which is proposed in ICCV 2019.

  * •

PSPNet [39]. A pyramid pooling module is designed to capture multi-scale
contextual information, which is accepted by CVPR 2017.

  * •

PSANet [40]. A point-wise spatial attention network to relax the local
neighborhood constraint for semantic segmentation, which is introduced in CVPR
2017.

  * •

APCNet [41]. An adaptive pyramid context network for semantic segmentation,
accepted by CVPR 2019.

  * •

FastFCN [42]. A joint pyramid upsampling module to formulate the task of
extracting high-resolution feature maps into a joint upsampling problem, which
is reported in ArXiv 2019.

  * •

UPerNet [43]. A hierarchical structure to learn from heterogeneous data from
multiple image datasets in semantic segmentation, which is proposed in ECCV
2018.

  * •

PointRend [44]. Taking image segmentation as a rendering problem, proposed in
CVPR 2020.

  * •

Deeplabv3 [45]. A segmentation framework that uses atrous convolution in
cascade or in parallel to capture multi-scale context by adopting multiple
atrous rates, which is introduced in CVPR 2017.

  * •

Segformer [46]. A simple, efficient yet powerful semantic segmentation
framework which unifies transformers with lightweight multilayer perceptron
(MLP) decoders, proposed in NeurIPS 2021.

  * •

MaskFormer [47]. A simple mask classification model that formulates semantic
segmentation as a per-pixel classification task, which is published in NeurIPS
2021.

  * •

SemanticFPN [48]. A panoptic feature pyramid network applied in semantic
segmentation, which is proposed in CVPR 2019.

  * •

NonLocalNet [31]. A non-local block to capture long-range dependencies for
semantic segmentation, which is accepted by CVPR 2018.

  * •

Deeplabv3Plus [49]. An extended version of Deeplabv3, which is published in
ECCV 2018.

  * •

MCIBI [50]. A semantic segmentation framework targeting mining contextual
information beyond image, which is accepted by ICCV 2021.

  * •

MCIBI++ [51]. An extended version of MCIBI, which is published in TPAMI 2022.

  * •

Mixed Precision (FP16) Training [52]. Mixed precision training aims at
training deep neural networks using half precision floating point (FP16)
numbers, and it is proposed in ArXiv 2017.

##  3 Benchmarks

The segmentation frameworks integrated into SSSegmenation can be trained on
various popular benchmark datasets, including LIP [53], ADE20k [54],
CityScapes [55], COCO Stuff [56], Pascal Context [57], VSPW [58], to name a
few. Table 1 shows the performance of various segmentation methods on Pascal
VOC, ADE20K and Cityscapes datasets. The readers can refer to the official
repository of SSSegmenation for training details and more segmentation
results.

Table 1:  The performance of different segmentation approaches on three
popular benchmark datasets. All results are obtained under a single-scale
setting without extra tricks, _e.g._ , flipping and multi-scale testing.

Method | Backbone | Stride | ADE20K (_train / val_) | Pascal VOC (_train / test_) | Cityscapes (_train / val_)
---|---|---|---|---|---
ANNNet | ResNet-50 | $8\times$ | 41.75 | 76.68 | 78.36
ANNNet | ResNet-101 | $8\times$ | 43.98 | 78.15 | 79.34
APCNet | ResNet-50 | $8\times$ | 43.47 | 76.97 | 79.02
APCNet | ResNet-101 | $8\times$ | 45.74 | 78.99 | 79.71
CCNet | ResNet-50 | $8\times$ | 42.47 | 77.43 | 79.15
CCNet | ResNet-101 | $8\times$ | 44.00 | 78.02 | 80.08
DANet | ResNet-50 | $8\times$ | 42.90 | 76.39 | 79.47
DANet | ResNet-101 | $8\times$ | 44.37 | 77.97 | 80.55
Deeplabv3 | ResNet-50 | $8\times$ | 43.19 | 77.72 | 79.62
Deeplabv3 | ResNet-101 | $8\times$ | 45.16 | 79.52 | 80.28
Deeplabv3Plus | ResNet-50 | $8\times$ | 44.51 | 77.43 | 80.38
Deeplabv3Plus | ResNet-101 | $8\times$ | 45.72 | 79.19 | 81.09
Deeplabv3Plus | ResNeSt-101 | $8\times$ | 46.48 | 79.76 | 80.30
DMNet | ResNet-50 | $8\times$ | 43.54 | 77.38 | 79.17
DMNet | ResNet-101 | $8\times$ | 45.53 | 79.15 | 79.90
DNLNet | ResNet-50 | $8\times$ | 43.50 | 76.73 | 79.75
DNLNet | ResNet-101 | $8\times$ | 44.88 | 78.37 | 80.64
EMANet | ResNet-50 | $8\times$ | 41.77 | 75.29 | 77.96
EMANet | ResNet-101 | $8\times$ | 44.39 | 76.43 | 79.54
EncNet | ResNet-50 | $8\times$ | 40.60 | 75.53 | 77.98
EncNet | ResNet-101 | $8\times$ | 43.43 | 77.61 | 78.70
GCNet | ResNet-50 | $8\times$ | 42.53 | 76.50 | 78.69
GCNet | ResNet-101 | $8\times$ | 44.19 | 78.81 | 79.93
ICNet | ResNet-50 | $8\times$ | - | - | 76.60
ICNet | ResNet-101 | $8\times$ | - | - | 76.27
ISANet | ResNet-50 | $8\times$ | 42.60 | 76.99 | 79.34
ISANet | ResNet-101 | $8\times$ | 44.08 | 78.60 | 80.58
ISNet | ResNet-50 | $8\times$ | 44.22 | - | 79.32
ISNet | ResNet-101 | $8\times$ | 45.92 | - | 80.56
Deeplabv3+MCIBI | ResNet-50 | $8\times$ | 44.39 | - | -
Deeplabv3+MCIBI | ResNet-101 | $8\times$ | 45.66 | - | -
UPerNet+MCIBI++ | ResNet-50 | $8\times$ | 44.30 | 79.48 | -
UPerNet+MCIBI++ | ResNet-101 | $8\times$ | 46.39 | 80.42 | -
NonLocalNet | ResNet-50 | $8\times$ | 42.15 | 77.08 | 78.34
NonLocalNet | ResNet-101 | $8\times$ | 44.49 | 78.89 | 80.42
OCRNet | ResNet-50 | $8\times$ | 42.47 | 76.75 | 79.40
OCRNet | ResNet-101 | $8\times$ | 43.99 | 78.82 | 80.61
OCRNet | HRNetV2p-W48 | $4\times$ | 44.03 | 77.60 | 81.44
PointRend | ResNet-50 | $8\times$ | 37.80 | 69.84 | 76.89
PointRend | ResNet-101 | $8\times$ | 40.26 | 72.31 | 78.80
PSANet | ResNet-50 | $8\times$ | 41.99 | 77.06 | 78.88
PSANet | ResNet-101 | $8\times$ | 43.85 | 78.97 | 79.65
PSPNet | ResNet-50 | $8\times$ | 42.64 | 77.93 | 79.05
PSPNet | ResNet-101 | $8\times$ | 44.55 | 79.04 | 79.94
FCN | ResNet-50 | $8\times$ | 36.96 | 67.80 | 75.16
FCN | ResNet-101 | $8\times$ | 41.22 | 70.59 | 76.31
FCN | BiSeNetV1+ResNet-18 | $32\times$ | - | - | 75.76
FCN | BiSeNetV1+ResNet-50 | $32\times$ | - | - | 77.78
FCN | BiSeNetV2 | $32\times$ | - | - | 74.62
FCN | CGNet-M3N21 | $8\times$ | - | - | 68.53
FCN | ERFNet | $8\times$ | - | - | 76.44
UPerNet | ResNet-50 | $8\times$ | 43.02 | 76.86 | 79.08
UPerNet | ResNet-101 | $8\times$ | 44.92 | 79.13 | 80.39
UPerNet | BEiT-B | $16\times$ | 53.22 | - | -
UPerNet | BEiT-L | $16\times$ | 56.52 | - | -
UPerNet | ConvNeXt-L-21k | $8\times$ | 53.41 | - | -
UPerNet | ConvNeXt-XL-21k | $8\times$ | 53.68 | - | -
UPerNet | Swin-Small | $32\times$ | 48.39 | - | -
UPerNet | Swin-Base | $32\times$ | 51.02 | - | -
UPerNet | SVT-Large | $32\times$ | 49.80 | - | -
UPerNet | PCPVT-Large | $32\times$ | 49.35 | - | -
MaskFormer | Swin-Small | $32\times$ | 49.91 | - | -
MaskFormer | Swin-Base | $32\times$ | 53.22 | - | -
SETR-Naive | ViT-Large | $32\times$ | 48.43 | - | -
SETR-PUP | ViT-Large | $32\times$ | 48.51 | - | -
SETR-MLA | ViT-Large | $32\times$ | 49.61 | - | -

##  4 Code Structure of SSSegmenation

SSSegmenation mainly consists of _dataset module_ , _parallel module_ ,
_backbone module_ , _segmentor module_ , _loss module_ , _optimizer module_
and _scheduler module_. Specifically, _dataset module_ is defined to load
training and testing images. _parallel module_ simply call the
$nn.parallel.DistributedDataParallel$ function in PyTorch to achieve
distributed training. _backbone module_ is employed to define the encoder
structure while _segmentor module_ is leveraged to define the decoder
structure. _loss module_ is introduced to define the objective functions for
semantic segmentation. _optimizer module_ and _scheduler module_ are designed
for optimizing the network parameters through back propagation algorithm.
Furthermore, it is also convenient to integrate more segmentation algorithms
into SSSegmenation since we only need to define our algorithm in the
corresponding module folder and import it in the $builder.py$ in the folder.

The minimum requirement for utilizing SSSegmenation is a CUDA development
environment with PyTorch and some necessary but easy-to-installed packages,
including _chainercv_ , _pillow_ , _opencv-python_ , _pandas_ , _cython_ ,
_numpy_ , _scipy_ , _tqdm_ and _argparse_. Also, you can install _timm_ ,
_mmcv_ and other packages to extend the functions of SSSegmenation.

In summary, SSSegmenation is a simple yet effective codebase for semantic
image segmentation. We hope this toolbox can further advance researches on
semantic image segmentation.

## References

  * [1] MMSegmentation Contributors.  MMSegmentation: Openmmlab semantic segmentation toolbox and benchmark.  https://github.com/open-mmlab/mmsegmentation, 2020.
  * [2] OpenSeg Contributors.  The official pytorch implementation of ocnet series and segfix.  https://github.com/openseg-group/openseg.pytorch, 2019.
  * [3] PyTorch-Encoding Contributors.  An optimized pytorch package with cuda backend.  https://github.com/zhanghang1989/PyTorch-Encoding, 2017.
  * [4] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer.  Automatic differentiation in pytorch.  2017\.
  * [5] Olaf Ronneberger, Philipp Fischer, and Thomas Brox.  U-net: Convolutional networks for biomedical image segmentation.  In Medical Image Computing and Computer-Assisted Intervention–MICCAI 2015: 18th International Conference, Munich, Germany, October 5-9, 2015, Proceedings, Part III 18, pages 234–241. Springer, 2015.
  * [6] Hangbo Bao, Li Dong, Songhao Piao, and Furu Wei.  Beit: Bert pre-training of image transformers.  arXiv preprint arXiv:2106.08254, 2021.
  * [7] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova.  Bert: Pre-training of deep bidirectional transformers for language understanding.  arXiv preprint arXiv:1810.04805, 2018.
  * [8] Xiangxiang Chu, Zhi Tian, Yuqing Wang, Bo Zhang, Haibing Ren, Xiaolin Wei, Huaxia Xia, and Chunhua Shen.  Twins: Revisiting the design of spatial attention in vision transformers.  Advances in Neural Information Processing Systems, 34:9355–9366, 2021.
  * [9] Tianyi Wu, Sheng Tang, Rui Zhang, Juan Cao, and Yongdong Zhang.  Cgnet: A light-weight context guided network for semantic segmentation.  IEEE Transactions on Image Processing, 30:1169–1179, 2020.
  * [10] Jingdong Wang, Ke Sun, Tianheng Cheng, Borui Jiang, Chaorui Deng, Yang Zhao, Dong Liu, Yadong Mu, Mingkui Tan, Xinggang Wang, et al.  Deep high-resolution representation learning for visual recognition.  IEEE transactions on pattern analysis and machine intelligence, 43(10):3349–3364, 2020.
  * [11] Eduardo Romera, José M Alvarez, Luis M Bergasa, and Roberto Arroyo.  Erfnet: Efficient residual factorized convnet for real-time semantic segmentation.  IEEE Transactions on Intelligent Transportation Systems, 19(1):263–272, 2017.
  * [12] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun.  Deep residual learning for image recognition.  In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
  * [13] Hang Zhang, Chongruo Wu, Zhongyue Zhang, Yi Zhu, Haibin Lin, Zhi Zhang, Yue Sun, Tong He, Jonas Mueller, R Manmatha, et al.  Resnest: Split-attention networks.  In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2736–2746, 2022.
  * [14] Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie.  A convnet for the 2020s.  In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11976–11986, 2022.
  * [15] Rudra PK Poudel, Stephan Liwicki, and Roberto Cipolla.  Fast-scnn: Fast semantic segmentation network.  arXiv preprint arXiv:1902.04502, 2019.
  * [16] Changqian Yu, Jingbo Wang, Chao Peng, Changxin Gao, Gang Yu, and Nong Sang.  Bisenet: Bilateral segmentation network for real-time semantic segmentation.  In Proceedings of the European conference on computer vision (ECCV), pages 325–341, 2018.
  * [17] Changqian Yu, Changxin Gao, Jingbo Wang, Gang Yu, Chunhua Shen, and Nong Sang.  Bisenet v2: Bilateral network with guided aggregation for real-time semantic segmentation.  International Journal of Computer Vision, 129:3051–3068, 2021.
  * [18] Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen.  Mobilenetv2: Inverted residuals and linear bottlenecks.  In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4510–4520, 2018.
  * [19] Andrew Howard, Mark Sandler, Grace Chu, Liang-Chieh Chen, Bo Chen, Mingxing Tan, Weijun Wang, Yukun Zhu, Ruoming Pang, Vijay Vasudevan, et al.  Searching for mobilenetv3.  In Proceedings of the IEEE/CVF international conference on computer vision, pages 1314–1324, 2019.
  * [20] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo.  Swin transformer: Hierarchical vision transformer using shifted windows.  In Proceedings of the IEEE/CVF international conference on computer vision, pages 10012–10022, 2021.
  * [21] 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.
  * [22] Jonathan Long, Evan Shelhamer, and Trevor Darrell.  Fully convolutional networks for semantic segmentation.  In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3431–3440, 2015.
  * [23] Tao Ruan, Ting Liu, Zilong Huang, Yunchao Wei, Shikui Wei, and Yao Zhao.  Devil in the details: Towards accurate single and multiple human parsing.  In Proceedings of the AAAI conference on artificial intelligence, volume 33, pages 4814–4821, 2019.
  * [24] Sixiao Zheng, Jiachen Lu, Hengshuang Zhao, Xiatian Zhu, Zekun Luo, Yabiao Wang, Yanwei Fu, Jianfeng Feng, Tao Xiang, Philip HS Torr, et al.  Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers.  In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 6881–6890, 2021.
  * [25] Zhenchao Jin, Bin Liu, Qi Chu, and Nenghai Yu.  Isnet: Integrate image-level and semantic-level context for semantic segmentation.  In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7189–7198, 2021.
  * [26] Hengshuang Zhao, Xiaojuan Qi, Xiaoyong Shen, Jianping Shi, and Jiaya Jia.  Icnet for real-time semantic segmentation on high-resolution images.  In Proceedings of the European conference on computer vision (ECCV), pages 405–420, 2018.
  * [27] Zilong Huang, Xinggang Wang, Lichao Huang, Chang Huang, Yunchao Wei, and Wenyu Liu.  Ccnet: Criss-cross attention for semantic segmentation.  In Proceedings of the IEEE/CVF international conference on computer vision, pages 603–612, 2019.
  * [28] Jun Fu, Jing Liu, Haijie Tian, Yong Li, Yongjun Bao, Zhiwei Fang, and Hanqing Lu.  Dual attention network for scene segmentation.  In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 3146–3154, 2019.
  * [29] Junjun He, Zhongying Deng, and Yu Qiao.  Dynamic multi-scale filters for semantic segmentation.  In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3562–3572, 2019.
  * [30] Yue Cao, Jiarui Xu, Stephen Lin, Fangyun Wei, and Han Hu.  Gcnet: Non-local networks meet squeeze-excitation networks and beyond.  In Proceedings of the IEEE/CVF international conference on computer vision workshops, pages 0–0, 2019.
  * [31] Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He.  Non-local neural networks.  In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794–7803, 2018.
  * [32] Jie Hu, Li Shen, and Gang Sun.  Squeeze-and-excitation networks.  In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7132–7141, 2018.
  * [33] Lang Huang, Yuhui Yuan, Jianyuan Guo, Chao Zhang, Xilin Chen, and Jingdong Wang.  Interlaced sparse self-attention for semantic segmentation.  arXiv preprint arXiv:1907.12273, 2019.
  * [34] Hang Zhang, Kristin Dana, Jianping Shi, Zhongyue Zhang, Xiaogang Wang, Ambrish Tyagi, and Amit Agrawal.  Context encoding for semantic segmentation.  In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 7151–7160, 2018.
  * [35] Yuhui Yuan, Xilin Chen, and Jingdong Wang.  Object-contextual representations for semantic segmentation.  In Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part VI 16, pages 173–190. Springer, 2020.
  * [36] Minghao Yin, Zhuliang Yao, Yue Cao, Xiu Li, Zheng Zhang, Stephen Lin, and Han Hu.  Disentangled non-local neural networks.  In Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part XV 16, pages 191–207. Springer, 2020.
  * [37] Zhen Zhu, Mengde Xu, Song Bai, Tengteng Huang, and Xiang Bai.  Asymmetric non-local neural networks for semantic segmentation.  In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 593–602, 2019.
  * [38] Xia Li, Zhisheng Zhong, Jianlong Wu, Yibo Yang, Zhouchen Lin, and Hong Liu.  Expectation-maximization attention networks for semantic segmentation.  In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 9167–9176, 2019.
  * [39] Hengshuang Zhao, Jianping Shi, Xiaojuan Qi, Xiaogang Wang, and Jiaya Jia.  Pyramid scene parsing network.  In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2881–2890, 2017.
  * [40] Hengshuang Zhao, Yi Zhang, Shu Liu, Jianping Shi, Chen Change Loy, Dahua Lin, and Jiaya Jia.  Psanet: Point-wise spatial attention network for scene parsing.  In Proceedings of the European conference on computer vision (ECCV), pages 267–283, 2018.
  * [41] Junjun He, Zhongying Deng, Lei Zhou, Yali Wang, and Yu Qiao.  Adaptive pyramid context network for semantic segmentation.  In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7519–7528, 2019.
  * [42] Huikai Wu, Junge Zhang, Kaiqi Huang, Kongming Liang, and Yizhou Yu.  Fastfcn: Rethinking dilated convolution in the backbone for semantic segmentation.  arXiv preprint arXiv:1903.11816, 2019.
  * [43] Tete Xiao, Yingcheng Liu, Bolei Zhou, Yuning Jiang, and Jian Sun.  Unified perceptual parsing for scene understanding.  In Proceedings of the European conference on computer vision (ECCV), pages 418–434, 2018.
  * [44] Alexander Kirillov, Yuxin Wu, Kaiming He, and Ross Girshick.  Pointrend: Image segmentation as rendering.  In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 9799–9808, 2020.
  * [45] Liang-Chieh Chen, George Papandreou, Florian Schroff, and Hartwig Adam.  Rethinking atrous convolution for semantic image segmentation.  arXiv preprint arXiv:1706.05587, 2017.
  * [46] Enze Xie, Wenhai Wang, Zhiding Yu, Anima Anandkumar, Jose M Alvarez, and Ping Luo.  Segformer: Simple and efficient design for semantic segmentation with transformers.  Advances in Neural Information Processing Systems, 34:12077–12090, 2021.
  * [47] Bowen Cheng, Alex Schwing, and Alexander Kirillov.  Per-pixel classification is not all you need for semantic segmentation.  Advances in Neural Information Processing Systems, 34:17864–17875, 2021.
  * [48] Alexander Kirillov, Ross Girshick, Kaiming He, and Piotr Dollár.  Panoptic feature pyramid networks.  In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 6399–6408, 2019.
  * [49] Liang-Chieh Chen, Yukun Zhu, George Papandreou, Florian Schroff, and Hartwig Adam.  Encoder-decoder with atrous separable convolution for semantic image segmentation.  In Proceedings of the European conference on computer vision (ECCV), pages 801–818, 2018.
  * [50] Zhenchao Jin, Tao Gong, Dongdong Yu, Qi Chu, Jian Wang, Changhu Wang, and Jie Shao.  Mining contextual information beyond image for semantic segmentation.  In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7231–7241, 2021.
  * [51] Zhenchao Jin, Dongdong Yu, Zehuan Yuan, and Lequan Yu.  Mcibi++: Soft mining contextual information beyond image for semantic segmentation.  IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022\.
  * [52] Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaiev, Ganesh Venkatesh, et al.  Mixed precision training.  arXiv preprint arXiv:1710.03740, 2017.
  * [53] Ke Gong, Xiaodan Liang, Dongyu Zhang, Xiaohui Shen, and Liang Lin.  Look into person: Self-supervised structure-sensitive learning and a new benchmark for human parsing.  In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 932–940, 2017.
  * [54] Bolei Zhou, Hang Zhao, Xavier Puig, Sanja Fidler, Adela Barriuso, and Antonio Torralba.  Scene parsing through ade20k dataset.  In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 633–641, 2017.
  * [55] Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele.  The cityscapes dataset for semantic urban scene understanding.  In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3213–3223, 2016.
  * [56] Holger Caesar, Jasper Uijlings, and Vittorio Ferrari.  Coco-stuff: Thing and stuff classes in context.  In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1209–1218, 2018.
  * [57] Roozbeh Mottaghi, Xianjie Chen, Xiaobai Liu, Nam-Gyu Cho, Seong-Whan Lee, Sanja Fidler, Raquel Urtasun, and Alan Yuille.  The role of context for object detection and semantic segmentation in the wild.  In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 891–898, 2014.
  * [58] Jiaxu Miao, Yunchao Wei, Yu Wu, Chen Liang, Guangrui Li, and Yi Yang.  Vspw: A large-scale dataset for video scene parsing in the wild.  In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 4133–4143, 2021.


[7]G^ #1,#2_#3,#4( #7|#5 #6)

# Secure Vehicular Communications through Reconfigurable Intelligent Surfaces

Yun Ai, Felipe A. P. de Figueiredo, Long Kong, Michael Cheffena,
Symeon Chatzinotas, , and Björn Ottersten Y. Ai and M. Cheffena are with the
Norwegian University of Science and Technology (NTNU), F. Figueiredo is with
Instituto Nacional de Telecomunicações (INATEL), Brazil, L. Kong, S.
Chatzinotas, and B. Ottersten are with the University of Luxembourg.

###### Abstract

Reconfigurable intelligent surfaces (RIS) is considered as a revolutionary
technique to improve the wireless system performance by reconfiguring the
radio wave propagation environment artificially. Motivated by the potential of
RIS in vehicular networks, we analyze the secrecy outage performance of RIS-
aided vehicular communications in this paper. More specifically, two vehicular
communication scenarios are considered, i.e., a vehicular-to-vehicular (V2V)
communication where the RIS acts as a relay and a vehicular-to-infrastructure
(V2I) scenario where the RIS functions as the receiver. In both scenarios, a
passive eavesdropper is present attempting to retrieve the transmitted
information. Closed-form expressions for the secrecy outage probability (SOP)
are derived and verified. The results demonstrate the potential of improving
secrecy with the aid of RIS under both V2V and V2I communications.

###### Index Terms:

Physical layer security, reconfigurable intelligent surfaces (RIS), vehicular
communications, V2V, V2I.

##  I Introduction

Reconfigurable intelligent surfaces (RIS) have recently appeared as a
revolutionary technique to enhance network coverage and overcome the high
attenuation of millimeter wave (mmWave) and THz systems [1]. By intelligently
controlling a large number of low-cost passive reflecting elements, the
electromagnetic waves can be adapted to the propagation environment. Thereby,
the RIS functions as a reconfigurable lens or reconfigurable mirror to
beamform the transmitted signals towards the desired user [2]. RIS are also
widely known as intelligent reconfigurable surfaces (IRS), software-
controllable surfaces, digitally controllable scatterers, and large
intelligent surfaces in literatures [1, 2].

Physical layer security (PLS) is widely considered as a complement to
conventional application layer encryption techniques to enhance the
communication secrecy in future (5G and beyond) communication systems [3]. It
has been demonstrated both theoretically and experimentally that channel
fading, which is usually regarded as an adverse factor in terms of
reliability, can be utilized to enhance communication security against
eavesdropping [3, 4, 5]. Due to potential of RIS and PLS technologies in
future networks, investigation of the combination of PLS and RIS-assisted
systems has attracted attention from the community recently [5, 6, 7]. The
optimized beamforming and phase shift design for secrecy rate of an RIS-
assisted mmWave system is investigated in [5]. In [6], the secrecy outage
probability (SOP) of an RIS-aided system is studied while the authors in [6]
focus on the SOP of an RIS-aided non-orthogonal multiple access (NOMA) system.
The expressions, in integral form, for the average secrecy capacity (ASC) of
an RIS-assisted vehicular network are derived in [7].

Figure 1: Considered PLS scenarios for RIS-aided vehicular networks.

The realization of future autonomous vehicles requires robust connections and
high quality-of-service (QoS) between vehicles (i.e., vehicular-to-vehicular
(V2V)) as well as between vehicle and infrastructure (i.e., vehicular-to-
infrastructure (V2I)) [8]. The aforementioned advantages of RIS technique make
RIS-assisted vehicular communication an appealing option to enhance vehicular
network connectivity [9]. Motivated by the latest advances in PLS analysis of
RIS-assisted systems as well as the potential of RIS-assisted communication in
vehicular networks, we study herein the secrecy performance of RIS-assisted
vehicular communications under passive eavesdropping. More specifically, we
consider the SOP performance under two communication scenarios of vehicular
communication, i.e., V2V and V2I scenarios. In the V2V scenario, the RIS
assists two vehicles that are blocked by other objects to communicate with
high QoS. In the V2I scenario, the vehicle sends essential information to the
RIS that is close to the receiver to ensure robust transmission of important
messages to the intelligent transport infrastructure.

The main contributions of this paper are: (1) We analyze the secrecy
performance of RIS-assisted vehicular communication under two realistic cases,
where RIS are used as part of dual-hop system and part of receiver,
respectively; (2) By avoiding applying the central limit theorem (CLT) and
instead adopting a more versatile approach in the RIS analysis, the obtained
results are also valid when the number of RIS elements is small; and (3) We
present some accurate or exact statistics for RIS related signal-to-noise
ratios (SNRs) (in Propositions 1, 2 and 3), which can be useful for RIS-
related analysis.

_Notations_ : $[0,x]^{+}=\max(x,0)$, $\mathbb{E}[\cdot]$ is the expectation
operator, $\Gamma(\cdot)$ and $\Gamma(\cdot,\cdot)$ are Gamma and incomplete
Gamma functions, respectively [10, Eq. 8.3], $K_{v}(\cdot)$ is the modified
Bessel function of second kind with order $v$ [10, Eq. 8.407], $J_{v}(\cdot)$
is the Bessel function of first kind [10, Eq. 8.402],
$G^{m,n}_{p,q}\\!(\cdot)$ is the Meijer G-function [10, Eq. (9.3)],
$H^{m,n}_{p,q}(\cdot)$ is the Fox H-function [11, Eq. 1.2], and
$H^{m,n:s,t:i,j}_{p,q:u,v:e,f}(\cdot)$ is the extended generalized bivariate
Fox H-function [11, Eq. 2.56].

##  II Channel and System Models

In this paper, we consider the secrecy outage probability of RIS-assisted V2V
and V2I systems. The considered classic Wyner’s wiretap model is illustrated
in Fig. 1.

###  II-A V2V Communications

In the V2V case, a vehicle _S_ communicates secret information with another
vehicle _D_ that has blockage between them with the aid of an RIS with $N$
elements. The signals sent by _S_ is overheard by an eavesdropper _E_ close to
_S_. All vehicles are assumed to be equipped with single antennas for
simplicity.

The received signal at the receiver vehicle _D_ via the RIS is

$\displaystyle
y_{D}=\sqrt{P_{s}}\cdot\mathbf{h}_{SR}^{T}\mathbf{\omega}\mathbf{h}_{RD}\cdot
s+w_{0},$ (1)

where $P_{s}$ is the transmit power of $S$, $s$ is the transmitted signal with
unit energy, $w_{0}$ is the zero-mean additive white Gaussian noise (AWGN)
with variance $N_{0}$,
$\mathbf{\omega}=\mathrm{diag}(\varpi_{1}(\phi_{1})e^{j\phi_{1}},\dots,\varpi_{N}(\phi_{N})e^{j\phi_{N}})$
is the diagonal matrix consisting of the reflection coefficients produced by
each reflection element of the RIS. The vector $\mathbf{h}_{SR}$ contains the
channel gains from _S_ to each element of RIS and the vector $\mathbf{h}_{RD}$
includes the channel gains from each element of RIS to _D_ , which are
expressed as [12]

$\displaystyle\mathbf{h}_{SR}$ $\displaystyle=$
$\displaystyle\mathbf{\alpha}^{T}\Theta\cdot d_{SR}^{-\frac{p_{1}}{2}},$ (2a)
$\displaystyle\mathbf{h}_{RD}$ $\displaystyle=$
$\displaystyle\mathbf{\beta}^{T}\mathbf{\varphi}\cdot
d_{RD}^{-\frac{p_{1}}{2}},$ (2b)

where the column vectors $\mathbf{\alpha}$ and $\mathbf{\beta}$ contain the
amplitudes of the corresponding channel gains. Each element of
$\mathbf{\alpha}$ follows independent Rayleigh distribution resulting from the
scattering around the vehicle. Similarly, every element of $\mathbf{\beta}$ is
also independent Rayleigh distributed.
$\Theta=[e^{-j\theta_{1}},\cdots,e^{-j\theta_{N}}]$ and
$\mathbf{\varphi}=[e^{-j\varphi_{1}},\cdots,e^{-j\varphi_{N}}]$ with
$\theta_{n}$ and $\varphi_{n}$, $n=1,\cdots,N$, being phase of the
corresponding link; $d_{xy}$ is the distance between nodes _x_ and _y_ ; and
$p_{1}$ is the path loss exponent for the link from or to the RIS.

From (1) and (2), the instantaneous SNR $\gamma_{\mathrm{\emph{D}}}$ at _D_
becomes

$\displaystyle\gamma_{\mathrm{\emph{D}}}=\frac{P_{s}\\!\cdot\\!\biggl{|}\sum\limits_{n=1}^{N}\alpha_{n}\beta_{n}\varpi_{n}(\phi_{n})\cdot
e^{j(\phi_{n}-\theta_{n}-\varphi_{n})}\biggr{|}^{2}}{N_{0}d_{SR}^{p_{1}}d_{RD}^{p_{1}}}.$
(3)

We first consider perfect knowledge of the channel state information (CSI) at
RIS as in [5, 6, 7], which enables ideal phase shifting (i.e.,
$\varpi_{n}(\phi_{n})=1$ and
$\sigma_{n}^{D}=\phi_{n}-(\theta_{n}+\varphi_{n}$) = 0). Then, the maximum
instantaneous SNR can be achieved at _D_ and is expressed as

$\displaystyle\gamma_{D}=\overline{\gamma}_{D}\cdot\left(\sum\limits_{n=1}^{N}\alpha_{n}\beta_{n}\right)^{2}=\overline{\gamma}_{D}\cdot\left(\sum\limits_{n=1}^{N}\emph{a}_{n}\right)^{2}=\mathcal{A}^{2},$
(4)

where
$\overline{\gamma}_{D}\\!=\\!\\!\frac{P_{s}}{N_{0}d_{SR}^{p_{1}}d_{RD}^{p_{1}}}$,
$\emph{a}_{n}\\!=\\!\\!\alpha_{n}\beta_{n}$, and
$\mathcal{A}\\!=\\!\\!\sqrt{\overline{\gamma}_{D}}\sum_{n=1}^{N}\\!\emph{a}_{n}$.

When $N$ is large, the CLT can be applied and the random variable (RV)
$\mathcal{A}$ can be approximated by a Gaussian RV and the RV $\gamma_{D}$ can
be considered to follow noncentral-$\chi^{2}$ distribution [2]. Nevertheless,
the CLT approximation becomes inaccurate while $N$ is not large. In [13], an
approximation of $\gamma_{D}$ is obtained by considering the RV
$\emph{a}_{n}=\alpha_{n}\beta_{n}$ as Gamma distributed with $\alpha_{n}$ and
$\beta_{n}$ being independent and identically distributed (i.i.d.) RVs.
However, it is unrealistic to assume that $\alpha_{n}$ and $\beta_{n}$ are
identically distributed since they correspond to two completely different
propagation links. Here, we present in Proposition 1 the statistics of
$\gamma_{D}$ under the assumption of $\alpha_{n}$ and $\beta_{n}$ being
independent but not identically distributed (i.n.i.d.) RVs by approximating
the RV $\mathcal{A}$ as a Gamma RV.

Proposition 1: When $h_{SR,n}\sim\mathcal{CN}(0,\nu_{SR})$ and
$h_{RD,n}\sim\mathcal{CN}(0,\nu_{RD})$ are i.n.i.d. complex Gaussian RVs with
$|h_{SR,n}|=\alpha_{n}$ and $|h_{RD,n}|=\beta_{n}$, then the RV
$\gamma_{D}=\overline{\gamma}_{D}\cdot\bigl{(}\sum_{n=1}^{N}\alpha_{n}\beta_{n}\bigr{)}^{2}$
under both small and large values of $N$ can be accurately described by the
following probability density function (PDF) and cumulative distribution
function (CDF):

$\displaystyle f_{\gamma_{D}}(x)=$
$\displaystyle\frac{1}{2\Gamma(k_{D})\eta_{D}^{k_{D}}}\cdot
x^{\left(\frac{k_{D}-2}{2}\right)}\cdot\exp\\!\\!\left(-\frac{\sqrt{x}}{\eta_{D}}\right),$
(5) $\displaystyle F_{\gamma_{D}}(x)=$ $\displaystyle
1-\frac{1}{\Gamma(k_{D})}\cdot\Gamma\\!\left(k_{D},\frac{\sqrt{x}}{\eta_{D}}\right),$
(6)

where $k_{D}=\frac{N\pi^{2}}{16-\pi^{2}},$ and
$\eta_{D}=\frac{\sqrt{\overline{\gamma}_{D}}(16-\pi^{2})\sqrt{\nu_{SR}\nu_{RD}}}{4\pi}$.

_Proof_ : Please refer to Appendix AAppendix A: Proof of Proposition 1 and
Fig. 2.

Figure 2: Verifications of statistics functions in Eqs. (5) and (7).

Due to the high mobility of vehicles _S_ and _D_ , perfect phase estimation
required for ideal RIS might be challenging. Next, we consider the worst case
of RIS phase shifting, where the phase errors $\sigma_{n}^{D}$ are uniformly
distributed in complex plane to evaluate the impact of imperfect RIS on
secrecy performance. To obtain the statistics of RV
$\gamma_{D}=\overline{\gamma}_{D}\cdot\left|\sum_{n=1}^{N}\alpha_{n}\beta_{n}e^{j\sigma_{n}^{D}}\right|^{2}$,
we interpret the mathematical problem as an isotropic two-dimensional random
walk, where the $n$-th step size is $\alpha_{n}\beta_{n}$ and $n$-th direction
is $\sigma_{n}^{D}$ that is uniformly distributed.

Proposition 2: When $h_{SR,n}\sim\mathcal{CN}(0,\nu_{SR})$ and
$h_{RD,n}\sim\mathcal{CN}(0,\nu_{RD})$ are i.n.i.d. complex Gaussian RVs with
$|h_{SR,n}|=\alpha_{n}$ and $|h_{RD,n}|=\beta_{n}$, and $\sigma_{n}^{D}$ is
uniformly distributed between $0$ and $2\pi$, the exact PDF and CDF of the RV
$\gamma_{D}=\overline{\gamma}_{D}\cdot\bigl{|}\sum_{n=1}^{N}\alpha_{n}\beta_{n}e^{j\sigma_{n}^{D}}\bigr{|}^{2}$
are given by

$\displaystyle f_{\gamma_{D}}(x)=$ $\displaystyle\frac{2\cdot
x^{\frac{N-1}{2}}}{\mathcal{B}}\cdot
K_{N-1}\\!\\!\left(2\sqrt{\frac{x}{\overline{\gamma}_{D}\nu_{SR}\nu_{RD}}}\right),$
(7) $\displaystyle F_{\gamma_{D}}(x)=$
$\displaystyle\frac{x^{\frac{N+1}{2}}}{\mathcal{B}}\cdot
G^{2,1}_{1,3}\\!\\!\left(\\!\frac{x}{\overline{\gamma}_{D}\nu_{SR}\nu_{RD}}\left|{}^{\frac{1-N}{2}}_{\frac{N-1}{2},-\frac{N-1}{2},-\frac{N+1}{2}}\right.\\!\\!\\!\right),$
(8)

where
$\mathcal{B}=\Gamma(N)\cdot(\overline{\gamma}_{D}\nu_{SR}\nu_{RD})^{\frac{N+1}{2}}$.

_Proof_ : Please refer to Appendix BAppendix B: Proof of Proposition 2 and
Fig. 2.

For the link between vehicles _S_ and _E_ , the double-bounce scattering
components caused by scatterers around both vehicles’ local environments lead
to a cascaded Rayleigh fading process [8]. Therefore, we use the double
Rayleigh model to characterize of the dynamic fading link between _S_ and _E_.
The PDF and CDF of the instantaneous SNR $\gamma_{E}$ are expressed as

$\displaystyle f_{\gamma_{E}}(x)$
$\displaystyle=\frac{2}{\overline{\gamma}_{E}}\cdot
K_{0}\\!\biggl{(}2\sqrt{\frac{x}{\overline{\gamma}_{E}}}\biggr{)},$ (9)
$\displaystyle F_{\gamma_{E}}(x)$
$\displaystyle=1-2\sqrt{\frac{x}{\overline{\gamma}_{E}}}\cdot
K_{1}\\!\biggl{(}2\sqrt{\frac{x}{\overline{\gamma}_{E}}}\biggr{)},$ (10)

where $\overline{\gamma}_{E}=\frac{P_{s}}{N_{0}d_{SE}^{p_{2}}}$, and $p_{2}$
is the path loss exponent for the links between vehicles.

###  II-B V2I Communications

Under the V2I scenario, a vehicle _S_ sends essential information to the
intelligent transportation infrastructure $D$ while an eavesdropper _E_ close
to _S_ attempts to eavesdrop the signals sent by _S_. The infrastructure $D$
consists of an RIS and RF receiver, where the RIS is deployed close to the RF
receiver such that the channel attenuation between them can be ignored [2].
Therefore, the RIS and RF receiver together are considered as a receiver from
the perspective of analytical analysis.

Under the described V2I scenario with ideal phase shifting, the instantaneous
SNR at _D_ can be written as

$\displaystyle\gamma_{D}=\overline{\gamma}_{D}\cdot\left(\sum\limits_{n=1}^{N}\alpha_{n}\right)^{2}=\overline{\gamma}_{D}\cdot\mathcal{C}^{2},$
(11)

where $\overline{\gamma}_{D}=\frac{P_{s}}{N_{0}d_{SD}^{p_{1}}}$ and
$\mathcal{C}=\sum_{n=1}^{N}\alpha_{n}$. To solve the statistics of
$\mathcal{C}$ is equivalent to obtain the statistics of the received signal
for the single-input multiple-output (SIMO) system with equal gain combining,
where the exact closed-form solution is unavailable for $N>2$. Next, we
present an accurate approximation of $\gamma_{D}$ in Proposition 3.

Proposition 3: When $h_{SD,n}\sim\mathcal{CN}(0,\nu_{SD})$ and
$\alpha_{n}=|h_{SD,n}|$, the PDF and CDF of the RV
$\gamma_{D}=\overline{\gamma}_{D}\cdot\bigl{|}\sum_{n=1}^{N}\alpha_{n}\bigr{|}^{2}$
can be closely approximated by

$\displaystyle f_{\gamma_{D}}(x)=$
$\displaystyle\frac{x^{N-1}}{(\overline{\gamma}_{D}\nu_{SD})^{N}\Omega_{D}^{N}\Gamma(N)}\cdot\exp\\!\left(-\frac{x}{\overline{\gamma}_{D}\nu_{SD}\Omega_{D}}\right),$
(12) $\displaystyle F_{\gamma_{D}}(x)=$ $\displaystyle
1-\frac{1}{\Gamma(N)}\cdot\Gamma\\!\left(N,\frac{x}{\overline{\gamma}_{D}\nu_{SD}\Omega_{D}}\right),$
(13)

where $\Omega_{D}=1+\left[\Gamma(\frac{3}{2})\right]^{2}\cdot(N-1)$.

_Proof_ : The results follow by employing the result in [14, Eq. (22)] for the
special case of independent Rayleigh RVs.

Under the V2I scenario, the PDF and CDF of the eavesdropper’s SNR are given as
in (9) and (10).

##  III Secrecy Performance Analysis

###  III-A Secrecy Outage Probability (SOP)

The secrecy rate indicates the maximum achievable rate the main channel can
achieve in secrecy. The instantaneous secrecy rate $C_{s}$ of the considered
wiretap model is [15]

$\displaystyle
C_{s}(\gamma_{D},\gamma_{E})=\left[\ln(1+\gamma_{D})-\ln(1+\gamma_{E}),0\right]^{+},$
(14)

where $\gamma_{D}$ and $\gamma_{E}$ are the instantaneous SNRs of the main
link from $S$ to $D$ and wiretap channel from $S$ to $E$, respectively.

Under passive eavesdropping, the legitimate transmitter $S$ and receiver $D$
have no channel state information (CSI) of the eavesdropper $E$. Then, the
node $S$ cannot adapt the coding scheme to $E$’s channel state, but resorts to
set the secrecy rate to a constant target rate $R_{s}$. When the instantaneous
secrecy rate is larger than the target rate, i.e., $C_{s}>R_{s}$, perfect
secrecy can be guaranteed. Otherwise, when the instantaneous secrecy rate is
less than the target rate, i.e., $C_{s}\leq R_{s}$, secrecy will be
compromised and secrecy outage occurs, the probability of which is given by
the secrecy performance metric SOP [3]. The SOP is mathematically expressed as
[15]

$\displaystyle P_{o}=$
$\displaystyle\mathrm{Pr}\left[C_{s}(\gamma_{D},\gamma_{E})\leq
R_{s}\right]=\mathrm{Pr}\left[\gamma_{D}\leq\Theta\gamma_{E}+\Theta-1\right]$
$\displaystyle=$
$\displaystyle\int_{0}^{\infty}\int_{0}^{(1+\gamma_{E})\Theta-1}f_{\gamma_{D},\gamma_{E}}(\gamma_{D},\gamma_{E})\,d\gamma_{D}d\gamma_{E},$
(15)

where $\Theta=\exp(R_{s})\geq 1$, and $f_{\gamma_{D},\gamma_{E}}(\cdot,\cdot)$
is the joint PDF of the RVs $\gamma_{D}$ and $\gamma_{E}$.

Next, we investigate the secrecy outage performance under V2V and V2I
scenarios, respectively.

###  III-B V2V Communications

With the RVs $\gamma_{D}$ and $\gamma_{E}$ being independent, and utilizing
the Parseval’s formula for Mellin’s transform, the SOP can be alternatively
evaluated as [16]

$\displaystyle P_{o}=$
$\displaystyle\int_{0}^{\infty}\biggl{[}\int_{0}^{(1+\gamma_{E})\Theta-1}f_{\gamma_{D}}(\gamma_{D})\,d\gamma_{D}\biggr{]}\cdot
f_{\gamma_{E}}(\gamma_{E})d\gamma_{E}$ $\displaystyle=$
$\displaystyle\int_{\mathcal{L}_{1}}\\!\\!\\!\\!\mathcal{M}[F_{\gamma_{D}}(\Theta
x\\!+\\!\Theta\\!-\\!1),1\\!-\\!s]\cdot\frac{\mathcal{M}[f_{\gamma_{E}}(x),s]}{2\pi
j}\,ds,$ (16)

where $\mathcal{L}_{1}$ is the integration path from $c-j\infty$ to
$c+j\infty$ with $c$ being some constant, and $\mathcal{M}[f(x),s]$ represents
the Mellin transform of the function $f(x)$ [10, Eq. 17.41].

Lemma 1: The SOP of the RIS-assisted vehicular communication under the V2V
scenario as illustrated in Fig. 1 with perfect RIS phase shifting can be
expressed as

$\displaystyle P_{o}=\mathcal{D}_{1}\cdot
H^{0,1:1,1:1,2}_{1,0:2,2:1,2}\\!\\!\left(\\!\begin{array}[]{c}\\!\\!\mathcal{E}_{1}\\!\\!\\\
\\!\\!-\\!\\!\end{array}\middle|\begin{array}[]{c}\\!\\!\mathcal{E}_{2}\\!\\!\\\
\\!\\!\mathcal{F}_{2}\\!\\!\\\
\end{array}\middle|\begin{array}[]{c}\\!\\!\mathcal{E}_{3}\\!\\!\\\
\\!\\!\mathcal{F}_{3}\\!\\!\\\
\end{array}\middle|\frac{\eta_{D}}{\sqrt{\Theta-1}},\frac{\Theta\overline{\gamma}_{E}}{\Theta\\!-\\!1}\\!\right),$
(23)

where
$\mathcal{D}_{1}\\!=\\!\frac{(\Theta-1)}{\overline{\gamma}_{E}\Theta\Gamma(k_{D})}$,
$\mathcal{E}_{1}=(2;1,1)$; $\mathcal{E}_{2}=(1-k_{D},1),(1,1)$;
$\mathcal{F}_{2}=(0,1),(1,\frac{1}{2})$; $\mathcal{E}_{3}=(1,1),(1,1)$; and
$\mathcal{F}_{3}=(1,1)$.

_Proof_ : Please refer to Appendix CAppendix C: Proof of Lemma 1.

Figure 3: SOP vs. $\frac{P_{s}}{N_{0}}$ for varying number of RIS elements
under V2V.

Figure 4: SOP vs. $N$ for varying number of RIS elements under V2I.

Lemma 2: The SOP of the RIS-assisted vehicular communication under the V2V
scenario as shown in Fig. 1 with uniform distributed phase estimation error
can be written as

$\displaystyle
P_{o}\\!=\\!\mathcal{D}_{2}\\!\cdot\\!H^{0,1:1,2:1,2}_{1,0:2,3:1,2}\\!\\!\left(\\!\begin{array}[]{c}\\!\\!\mathcal{E}_{4}\\!\\!\\\
\\!\\!-\\!\\!\end{array}\middle|\begin{array}[]{c}\\!\\!\mathcal{E}_{5}\\!\\!\\\
\\!\\!\mathcal{F}_{5}\\!\\!\\\
\end{array}\middle|\begin{array}[]{c}\\!\\!\mathcal{E}_{6}\\!\\!\\\
\\!\\!\mathcal{F}_{6}\\!\\!\\\
\end{array}\middle|\frac{\overline{\gamma}_{D}\nu_{SR}}{(\Theta\\!-\\!1)\nu_{RD}^{-1}},\\!\frac{\Theta\overline{\gamma}_{E}}{\Theta\\!-\\!\\!1}\\!\right),$
(30)

where $\mathcal{D}_{2}=(\mathcal{B}\Theta)^{-1}(\theta-1)^{\frac{N+3}{2}}$,
$\mathcal{E}_{4}=(\frac{N+5}{2};1,1)$;
$\mathcal{E}_{5}=(\frac{3-N}{2},1),(\frac{1+N}{2},1),(\frac{3+N}{2},1)$;
$\mathcal{F}_{5}=(\frac{N-1}{2},1),(\frac{3+N}{2},1)$;
$\mathcal{E}_{6}=(1,1),(1,1)$; and $\mathcal{F}_{6}=(1,1)$.

_Proof_ : The results follow by applying the same rationale as in Appendix
CAppendix C: Proof of Lemma 1.

###  III-C V2I Communications

Under the V2I scenario and with the independence between the RVs $\gamma_{D}$
and $\gamma_{E}$, the SOP can be evaluated as [17]

$\displaystyle P_{o}=$ $\displaystyle\int_{0}^{\infty}F_{\gamma_{D}}(\Theta
x+\Theta-1)\cdot f_{\gamma_{E}}(x)\,dx.$ (31)

Lemma 3: The SOP of the RIS-aided vehicular network under the V2I scenario
depicted in Fig. 1 can be evaluated by

$\displaystyle P_{o}=$ $\displaystyle
1-\frac{1}{\overline{\gamma}_{E}}\\!\cdot\\!\sum_{k=1}^{N-1}\frac{e^{-\frac{\Theta-1}{\overline{\gamma}_{D}\Omega_{D}}}}{(\overline{\gamma}_{D}\Omega_{D})^{k}\cdot
k!}\cdot\\!\sum_{j=0}^{k}\Theta^{k}\\!\cdot\\!{k\choose
j}\\!\cdot\\!\left(1-\frac{1}{\Theta}\right)^{k-j}$
$\displaystyle\cdot\left(\frac{\Theta}{\overline{\gamma}_{D}\Omega_{D}}\right)^{-(j+1)}\cdot
G^{2,1}_{1,2}\\!\left(\frac{\overline{\gamma}_{D}\Omega_{D}}{\Theta\overline{\gamma}_{E}}\left|{}^{-j}_{0,0}\right.\right).$
(32)

_Proof_ : Please refer to Appendix DAppendix D: Proof of Lemma 2.

##  IV Numerical Results and Discussions

In this section, we numerically evaluate the secrecy outage performance under
the considered V2V and V2I scenarios. The path loss exponents are set as
$p_{1}=2.1$ and $p_{2}=2.3$ for simulation purpose.

Figure 4 demonstrates the SOP in terms of the transmit SNR
$\gamma_{t}=\frac{P_{s}}{N_{0}}$ under the V2V scenario. It can be seen that
the SOP performance improves significantly by even a relatively small increase
in the number of RIS antenna elements. However, when the SNR is large enough,
the SOP performance stagnates and further increasing the transmit SNR (namely
the transmit power) does not improve the SOP performance any longer. Instead,
increasing the number $N$ can significantly improve this performance bound
that can not be enhanced by increasing the transmission power. It is obvious
that the curves for perfect IRS shifting and random phase shifting represent
the upper and lower limits of the secrecy outage performance, respectively,
when only phase shifting is considered. The large differences between the
lower and upper limits demonstrate the adverse effect of imperfect phase
shifting for the RIS-aided system performance.

Figure 4 shows the SOP performance improvement with the increase of the number
of RIS elements $N$ under the V2I scenario. As expected, when the number of
RIS elements $N$ increases, the SOP performance improves even when the signal
attenuation for the legitimate receiver is much larger than that to the
eavesdropper because of longer signal transmission. It is also observed that
the SOP in the logarithm scale exhibits a linear relation with respect to the
number $N$ when $N$ is large. The slope of the linear relation is dependent on
the distances between the communicating entities and is irrelevant to the
transmission power.

## Appendix A: Proof of Proposition 1

We assume that the RV
$\mathcal{A}=\sqrt{\overline{\gamma}_{D}}\cdot\sum_{n=1}^{N}\alpha_{n}\beta_{n}$
in (4) can be approximated by a Gamma RV $\mathcal{Z}$ with shape parameter
$k_{D}$ and scale parameter $\eta_{D}$. It follows immediately that the first
and second moments of the RV $\mathcal{Z}$ are
$\mathbb{E}[\mathcal{Z}]=k_{D}\eta_{D}$ and
$\mathbb{E}[\mathcal{Z}^{2}]=k_{D}\eta_{D}^{2}$, respectively. Since
$h_{SR,n}\sim\mathcal{CN}(0,\nu_{SR})$ and
$\beta_{n}\sim\mathcal{CN}(0,\nu_{RD})$, we have that $\alpha_{n}=|h_{SR,n}|$
is a Rayleigh RV with $\mathbb{E}[\alpha_{n}]=\frac{\sqrt{\pi\nu_{SR}}}{2}$
and $\mathbb{E}[\alpha_{n}^{2}]=\nu_{SR}$. Similarly, we have
$\mathbb{E}[\beta_{n}]=\frac{\sqrt{\pi\nu_{RD}}}{2}$ and
$\mathbb{E}[\beta_{n}^{2}]=\nu_{RD}$. Next, we find the first and second
moments of the RV $\mathcal{A}$ as follows:

$\displaystyle\mathbb{E}[\mathcal{A}]=$
$\displaystyle\sqrt{\overline{\gamma}_{D}}\\!\cdot\\!\sum\limits_{n=1}^{N}\\!\mathbb{E}\\!\left[\alpha_{n}\right]\mathbb{E}\\!\left[\beta_{n}\right]=\frac{\sqrt{\pi^{2}\nu_{SR}\nu_{RD}}}{4\cdot(\sqrt{\overline{\gamma}_{D}}\cdot
N)^{-1}},$ (33) $\displaystyle\mathbb{E}[\mathcal{A}^{2}]=$
$\displaystyle\mathbb{E}\\!\biggl{[}\\!\\!\biggl{(}\sqrt{\overline{\gamma}_{D}}\cdot\sum\limits_{n=1}^{N}\alpha_{n}\beta_{n}\biggr{)}^{2}\biggr{]}\\!=\\!\overline{\gamma}_{D}\\!\cdot\\!\sum\limits_{n=1}^{N}\mathbb{E}\\!\left[\alpha_{n}^{2}\right]\mathbb{E}\\!\left[\beta_{n}^{2}\right]$
$\displaystyle+\overline{\gamma}_{D}\cdot\sum\limits_{n=1}^{N}\sum\limits_{m\neq
n}^{N}\mathbb{E}\\!\left[\alpha_{n}\right]\cdot\mathbb{E}\\!\left[\beta_{n}\right]\mathbb{E}\\!\left[\alpha_{m}\right]\mathbb{E}\\!\left[\beta_{m}\right]$
$\displaystyle=$
$\displaystyle\overline{\gamma}_{D}\cdot\\!\\!\left[N\nu_{SR}\nu_{RD}+\frac{\pi^{2}\nu_{SR}\nu_{RD}\cdot
N(N-1)}{16}\right].$ (34)

Solving equalities $\mathbb{E}[\mathcal{A}]=\mathbb{E}[\mathcal{Z}]$ and
$\mathbb{E}[\mathcal{A}^{2}]=\mathbb{E}[\mathcal{Z}^{2}]$, we obtain the
values of $k_{D}$ and $\eta_{D}$, which determines the statistics of Gamma RV
$\mathcal{Z}$. Finally, with change of RV $\gamma_{D}=\mathcal{Z}^{2}$, we
obtain the statistic function of RV $\gamma_{D}$ as in Proposition 1.

## Appendix B: Proof of Proposition 2

The RV
$r=\bigl{|}\sum_{n=1}^{N}\alpha_{n}\beta_{n}e^{j\sigma_{n}^{D}}\bigr{|}$ can
be interpreted as the distance to origin after $N$ ’random walks’ with the
$n$-th step of length $r_{n}=\alpha_{n}\beta_{n}$ in the direction of
$\sigma_{n}^{D}$. We first obtain the statistics of the RV $r_{n}$, which is
the product of two i.n.i.d Rayleigh RVs.

$\displaystyle f_{r_{n}}(r)=$
$\displaystyle\int_{0}^{\infty}\\!\frac{1}{x}f_{\alpha_{n}}\\!(x)f_{\beta_{n}}\\!\\!\left(\frac{r}{x}\right)dx\\!=\\!\\!\\!\int_{0}^{\infty}\\!\frac{4r\\!\cdot\\!e^{-\frac{x^{2}}{\nu_{SR}}-\frac{r^{2}}{\nu_{RD}x^{2}}}}{x\nu_{SR}\nu_{RD}}dx$
$\displaystyle=$ $\displaystyle\frac{4r}{\nu_{SR}\nu_{RD}}\cdot
K_{0}\\!\\!\left(\frac{2r}{\nu_{SR}\nu_{RD}}\right).$ (35)

Since the angle density functions of $\sigma_{n}^{D}$ are uniform, the
conditional PDF of RV $r$ is given with the Kluyver’s result in terms of
integral over Bessel functions [18, p. 420]

$\displaystyle
f_{r}(r|r_{1},\cdots,r_{N})\\!=\\!\\!\\!\int_{0}^{\infty}\\!\frac{rJ_{0}\\!(rx)}{x^{-1}}J_{0}\\!(r_{1}x)\dots
J_{0}\\!(r_{N}x)dx.$ (36)

Then, the PDF of the RV $r$ can be obtained directly from

$\displaystyle
f_{r}(r)=r\left[\frac{4}{\nu_{SR}\nu_{RD}}\right]^{N}\\!\\!\\!\int_{0}^{\infty}\\!\\!\\!\\!xJ_{0}(rx)\\!\\!\int_{0}^{\infty}\\!\\!\\!\\!\\!\cdots\\!\\!\\!\int_{0}^{\infty}\\!\\!\\!r_{1}K_{0}\\!\biggl{(}\\!\frac{2r_{1}}{\nu_{SR}\nu_{RD}}\\!\biggr{)}$
$\displaystyle\quad\cdot\\!J_{0}(r_{1}x)dr_{1}\dots
r_{N}K_{0}\\!\biggl{(}\\!\frac{2r_{N}}{\nu_{SR}\nu_{RD}}\\!\biggr{)}\cdot
J_{0}(r_{N}x)dr_{N}dx.$ (37)

Next, utilizing the following equalities [18, Chpt. 13]

$\displaystyle\int_{0}^{\infty}\\!\\!\\!r_{n}K_{0}\\!\\!\left(\\!\frac{2r_{n}}{\nu_{SR}\nu_{RD}}\\!\right)J_{0}(r_{n}x)dr_{n}\\!=\\!\frac{(\nu_{SR}\nu_{RD})^{2}}{(\nu_{SR}\nu_{RD}x)^{2}\\!+\\!4},$
(38)
$\displaystyle\int_{0}^{\infty}\\!\\!\frac{(\nu_{SR}\nu_{RD})^{2N}J_{0}(rx)x}{[(\nu_{SR}\nu_{RD}x)^{2}\\!+\\!4]^{N}}dx\\!=\\!\frac{4^{1-N}K_{N-1}\\!\bigl{(}\\!\frac{2r}{\nu_{SR}\nu_{RD}}\\!\bigr{)}}{\Gamma\\!(N)(\nu_{SR}\nu_{RD}r)^{1-N}},$
(39)

in (37) leads to the PDF of the RV $r$. With change of RV
$\gamma_{D}=\overline{\gamma}_{D}r^{2}$, we obtain the exact PDF of the RV
$\gamma_{D}$ in (7). The CDF of $\gamma_{D}$ in (8) follows by using its
relation with the PDF.

## Appendix C: Proof of Lemma 1

We first solve the function $\mathcal{M}[F_{\gamma_{D}}(\Theta
x+\Theta-1),1-s]$. Based on the definition of Mellin transform, we have

$\displaystyle\mathcal{M}[F_{\gamma_{D}}(\Theta
x+\Theta-1),1-s]\\!=\\!\int_{0}^{\infty}\\!\\!\\!x^{-s}F_{\gamma_{D}}(\Theta
x+\Theta-1)\,dx$
$\displaystyle\stackrel{{\scriptstyle(a)}}{{=}}\int_{0}^{\infty}\\!\frac{x^{-s}}{\Gamma(k_{D})}\cdot
G^{\,*,1}_{1,1}\lparen\,\\!k_{D},0\\!|\begin{smallmatrix}2\\\
\\!1\\!\end{smallmatrix}\rparen{\\!\frac{\sqrt{\Theta
x+\Theta-1}}{\eta_{D}}}\,dx\stackrel{{\scriptstyle(b)}}{{=}}\frac{(2\pi
j)^{-1}}{\Gamma(k_{D})}$
$\displaystyle\quad\cdot\int_{\mathcal{L}_{2}}\\!\\!\int_{0}^{\infty}\\!\\!\\!\\!x^{-s}\frac{\Gamma(k_{D}\\!+\\!\xi)\Gamma(-\xi)}{\Gamma(1\\!-\\!\xi)}\\!\\!\left[\frac{\sqrt{\Theta
x\\!+\\!\Theta\\!-\\!1}}{\eta_{D}}\right]^{-\xi}\\!\\!\\!dxd\xi,$ (40)

where $(a)$ is obtained by converting the incomplete Gamma function in (6)
into Meijer G-function; and $(b)$ is derived by representing the Meijer
G-function in terms of contour integral and changing the integration order.
The inner integral in (40) can be solved with the help of [10, Eq. (3.194.3)]
as

$\displaystyle\int_{0}^{\infty}\\!\frac{x^{-s}}{(\Theta
x+\Theta-1)^{\frac{\xi}{2}}}\,dx=\frac{\Gamma(1-s)\Gamma(s+\frac{\xi}{2}-1)}{\Gamma(\frac{\xi}{2})(\Theta-1)^{\frac{\xi}{2}}\bigl{(}\frac{\Theta}{\Theta-1}\bigr{)}^{1-s}}.$
(41)

Substituting (41) into (40), we obtain after some algebra

$\displaystyle\mathcal{M}[F_{\gamma_{D}}(\Theta
x\\!+\\!\Theta\\!-\\!1),1\\!-\\!s]\stackrel{{\scriptstyle(c)}}{{=}}\frac{\Gamma(1\\!-\\!s)}{\Gamma(k_{D})}\cdot\left(\frac{\Theta}{\Theta\\!-\\!1}\right)^{s-1}\cdot\frac{1}{2\pi
j}$
$\displaystyle\quad\\!\\!\cdot\int_{\mathcal{L}_{2}}\\!\\!\\!\frac{\Gamma(k_{D}\\!+\\!\xi)\Gamma(-\xi)\Gamma(s\\!+\\!\frac{\xi}{2}\\!-\\!1)}{\Gamma(1\\!-\\!\xi)\Gamma(\frac{\xi}{2})}\cdot\left(\frac{\sqrt{\Theta\\!-\\!1}}{\eta_{D}}\right)^{-\xi}\,d\xi,$
(42)

where $(c)$ is obtained with the aid of [10, Eq. (3.194.3)] with
$\mathcal{L}_{2}$ being some contour.

Rewriting the Bessel function in (9) in Meijer G-function’s form, the Mellin
transform $\mathcal{M}[f_{\gamma_{E}}(x),s]$ can be solved as

$\displaystyle\mathcal{M}[f_{\gamma_{E}}(x),s]\\!=\\!\\!\int_{0}^{\infty}\\!\\!\frac{x^{s-1}}{\overline{\gamma}_{E}}\cdot
G^{2,0}_{0,2}\\!\left(\\!\\!\frac{x}{\overline{\gamma}_{E}}\left|{}^{-}_{0,0}\right.\\!\\!\right)dx\\!=\\!\frac{\Gamma\\!\left(s\right)\cdot\Gamma\\!\left(s\right)\overline{\gamma}_{E}^{s}}{\overline{\gamma}_{E}}.$
(43)

Next, substituting (42) and (43) into (16), the SOP can be expressed, after
some mathematical manipulations, as the following double contour integral:

$\displaystyle P_{o}=$
$\displaystyle\frac{(\Theta-1)}{\overline{\gamma}_{E}\Theta\Gamma(k_{D})}\cdot\left(\frac{1}{2\pi
j}\right)^{2}\cdot\int_{\mathcal{L}_{1}}\\!\\!\int_{\mathcal{L}_{2}}\\!\\!\left(\frac{\eta_{D}}{\sqrt{\Theta-1}}\right)^{\xi}$
$\displaystyle\cdot\left(\frac{\Theta\cdot\overline{\gamma}_{E}}{\Theta-1}\right)^{s}\cdot\frac{\Gamma(1-s)\cdot\Gamma(s)\cdot\Gamma(s)}{\Gamma(1-\xi)\cdot\Gamma(\frac{\xi}{2})}\cdot\Gamma\\!\left(k_{D}+\xi\right)$
$\displaystyle\cdot\Gamma\\!\left(-\xi\right)\cdot\Gamma\\!\left(s+\xi-1\right)d\xi
ds.$ (44)

Recalling the representation of bivariate Fox H-function in terms of double
contour integral [11, Eq. 2.56] for (44), the exact expression for the SOP can
be expressed in terms of bivariate Fox H-function as shown in Lemma 1.

## Appendix D: Proof of Lemma 2

Expressing the incomplete Gamma function in (13) in series [10, Eq. (8.354)]
and then substituting the resulting expression of CDF and (9) into (31), the
SOP can be rewritten as

$\displaystyle P_{o}\\!=$
$\displaystyle\\!\\!\int_{0}^{\infty}\\!\\!\\!\frac{2}{\overline{\gamma}_{E}}K_{0}\\!\biggl{(}2\sqrt{\frac{x}{\overline{\gamma}_{E}}}\biggr{)}\\!\\!\cdot\\!\\!\biggl{[}\\!1\\!-\\!e^{-\frac{(1\\!+\\!x)\Theta\\!-\\!1}{\overline{\gamma}_{D}\Omega_{D}}}\\!\\!\cdot\\!\\!\\!\sum_{k=1}^{N\\!-\\!1}\\!\\!\frac{[(1\\!+\\!x)\Theta\\!-\\!1]^{k}}{(\overline{\gamma}_{D}\Omega_{D})^{k}\cdot
k!}\\!\biggr{]}dx$ $\displaystyle=$ $\displaystyle
1-\frac{2}{\overline{\gamma}_{E}}\cdot
e^{-\frac{\Theta-1}{\overline{\gamma}_{D}\Omega_{D}}}\cdot\sum_{k=1}^{N-1}\frac{1}{(\overline{\gamma}_{D}\Omega_{D})^{k}\cdot
k!}$
$\displaystyle\cdot\\!\\!\int_{0}^{\infty}\\!\\!K_{0}\\!\biggl{(}2\sqrt{\frac{x}{\overline{\gamma}_{E}}}\biggr{)}\\!\cdot
e^{-\frac{\Theta
x}{\overline{\gamma}_{D}\Omega_{D}}}\\!\cdot\left[(1\\!+\\!x)\Theta-1\right]^{k}dx.$
(45)

Rewriting $\left[(1+x)\Theta-1\right]^{k}$ in series and relevant terms in
Meijer G-functions, the definite integral in (45) becomes

$\displaystyle\mathcal{I}=$
$\displaystyle\sum_{j=0}^{k}\frac{\Theta^{k}\cdot{k\choose
j}}{\left(1\\!\\!-\\!\\!\frac{1}{\Theta}\right)^{j-k}}\\!\cdot\\!\\!\\!\int_{0}^{\infty}\\!\\!\\!x^{j}\\!\cdot\\!G^{1,0}_{0,1}\\!\biggl{(}\\!\\!\frac{\Theta
x}{\overline{\gamma}_{D}\Omega_{D}}\left|{}^{-}_{0}\right.\\!\\!\biggr{)}\\!\cdot\\!G^{2,0}_{0,2}\\!\biggl{(}\\!\frac{x}{\overline{\gamma}_{E}}\left|{}^{-}_{0,0}\right.\\!\\!\biggr{)}\\!dx$
$\displaystyle=$ $\displaystyle\sum_{j=0}^{k}\frac{\Theta^{k}\cdot{k\choose
j}\cdot\left(1-\frac{1}{\Theta}\right)^{k-j}}{2\cdot\bigl{(}\frac{\Theta}{\overline{\gamma}_{D}\Omega_{D}}\bigr{)}^{(j+1)}}\cdot
G^{2,1}_{1,2}\\!\biggl{(}\frac{\overline{\gamma}_{D}\Omega_{D}}{\Theta\overline{\gamma}_{E}}\left|{}^{-j}_{0,0}\right.\biggr{)}.$
(46)

Finally, substituting (46) into (45) leads to the closed-form expression for
the SOP under the V2I scenario in Lemma 2.

## References

  * [1] Q. Wu and R. Zhang, “Towards smart and reconfigurable environment: Intelligent reflecting surface aided wireless network,” _IEEE Communications Magazine_ , vol. 58, no. 1, pp. 106–112, January 2019.
  * [2] E. Basar, M. Di Renzo, J. De Rosny, M. Debbah, M.-S. Alouini, and R. Zhang, “Wireless communications through reconfigurable intelligent surfaces,” _IEEE Access_ , vol. 7, pp. 116 753–116 773, September 2019.
  * [3] J. Barros and M. R. Rodrigues, “Secrecy capacity of wireless channels,” in _Proceedings of IEEE International Symposium on Information Theory (ISIT)_. Seattle, Washington, USA: IEEE, July 2006, pp. 356–360.
  * [4] Y. Ai, M. Cheffena, T. Ohtsuki, and H. Zhuang, “Secrecy performance analysis of wireless sensor networks,” _IEEE Sensors Letters_ , vol. 3, no. 5, pp. 1–4, May 2019.
  * [5] J. Qiao and M.-S. Alouini, “Secure transmission for intelligent reflecting surface-assisted mmWave and Terahertz systems,” _IEEE Wireless Communications Letters_ , vol. 9, no. 10, pp. 1743–1747, June 2020.
  * [6] L. Yang, Y. Jinxia, W. Xie, M. Hasna, T. Tsiftsis, and M. Di Renzo, “Secrecy performance analysis of RIS-aided wireless communication systems,” _IEEE Transactions on Vehicular Technology_ , vol. 69, no. 10, pp. 12 296–12 300, July 2020.
  * [7] A. U. Makarfi, K. M. Rabie, O. Kaiwartya, X. Li, and R. Kharel, “Physical layer security in vehicular networks with reconfigurable intelligent surfaces,” in _Proceedings of IEEE Vehicular Technology Conference (VTC-Spring)_. Antwerp, Belgium: IEEE, May 2020, pp. 1–6.
  * [8] Y. Ai, M. Cheffena, A. Mathur, and H. Lei, “On physical layer security of double Rayleigh fading channels for vehicular communications,” _IEEE Wireless Communications Letters_ , vol. 7, no. 6, pp. 1038–1041, December 2018\.
  * [9] Y. Liu, X. Liu, X. Mu, T. Hou, J. Xu, Z. Qin _et al._ , “Reconfigurable intelligent surfaces: Principles and opportunities,” _arXiv preprint arXiv:2007.03435_ , 2020.
  * [10] I. S. Gradshteyn and I. M. Ryzhik, _Table of Integrals, Series, and Products_ , 7th ed. Burlington, MA, USA: Academic Press, 2007.
  * [11] A. M. Mathai, R. K. Saxena, and H. J. Haubold, _The H-Function: Theory and Applications_. New York, NY, USA: Springer, 2009.
  * [12] L. Yang, F. Meng, J. Zhang, M. O. Hasna, and M. Di Renzo, “On the performance of RIS-assisted dual-hop UAV communication systems,” _IEEE Transactions on Vehicular Technology_ , vol. 69, no. 9, pp. 10 385–10 390, June 2020.
  * [13] S. Atapattu, R. Fan, P. Dharmawansa, G. Wang, J. Evans, and T. A. Tsiftsis, “Reconfigurable intelligent surface assisted two-way communications: Performance analysis and optimization,” _arXiv preprint arXiv:2001.07907_ , 2020.
  * [14] Z. Hadzi-Velkov, N. Zlatanov, and G. K. Karagiannidis, “An accurate approximation to the distribution of the sum of equally correlated Nakagami-$m$ envelopes and its application in equal gain diversity receivers,” in _Proceedings of IEEE International Conference on Communications (ICC)_. Dresden, Germany: IEEE, June 2009, pp. 1–5.
  * [15] Y. Ai, A. Mathur, H. Lei, M. Cheffena, and I. S. Ansari, “Secrecy enhancement of RF backhaul system with parallel FSO communication link,” _Optics Communications_ , vol. 475, November 2020.
  * [16] Y. Ai, L. Kong, and M. Cheffena, “Secrecy outage analysis of double shadowed Rician channels,” _Electronics Letters_ , vol. 55, no. 13, pp. 765–767, June 2019.
  * [17] Y. Ai, A. Mathur, M. Cheffena, M. R. Bhatnagar, and H. Lei, “Physical layer security of hybrid satellite-FSO cooperative systems,” _IEEE Photonics Journal_ , vol. 11, no. 1, pp. 1–14, February 2019.
  * [18] G. N. Watson, _A Treatise on the Theory of Bessel Functions_. Cambridge, UK: Cambridge University Press, 1922.