360SFUDA++: Towards Source-free UDA for Panoramic Segmentation by Learning Reliable Category Prototypes
Xu Zheng Pengyuan Zhou Athanasios V. Vasilakos Lin Wang







Journal of  Class Files, Vol. 14, No. 8, August 2021
Shell et al.: A Sample Article Using IEEEtran.cls for IEEE Journals





360SFUDA++: Towards Source-free UDA for Panoramic Segmentation by Learning Reliable Category Prototypes
    Xu Zheng, Student Member, IEEE,
        
        Pengyuan Zhou,
        Athanasios V. Vasilakos Senior Member, IEEE, 

        Lin Wang*, Member, IEEE,* Corresponding Author





Xu Zheng is with the AI Thrust, HKUST(GZ), Guangdong, China. E-mail: zhengxu128@gmail.com. Pengyuan Zhou is with the Aarhus University, Denmark. E-mail:pengyuan.zhou@ece.au.dk. Athanasios V. Vasilakos is with the University of Agder, Norway. E-mail: th.vasilakos@gmail.com.
Lin Wang is with AI/CMA Thrust, HKUST(GZ) and Dept. of CSE, HKUST, Hong Kong SAR, China, E-mail: linwang@ust.hk.


    April 29, 2024
===========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================




In this paper, we address the challenging source-free unsupervised domain adaptation (SFUDA) for pinhole-to-panoramic semantic segmentation, 
given only a pinhole image pre-trained model (, source) and unlabeled panoramic images (, target). 
Tackling this problem is non-trivial due to three critical challenges: 1) semantic mismatches from the distinct Field-of-View (FoV) between domains, 2) style discrepancies inherent in the UDA problem, and 3) inevitable distortion of the panoramic images. To tackle these problems, we propose 360SFUDA++ that effectively extracts knowledge from the source pinhole model with only unlabeled panoramic images and transfers the reliable knowledge to the target panoramic domain.
Specifically, we first utilize Tangent Projection (TP) as it has less distortion and meanwhile slits the equirectangular projection (ERP) to patches with fixed FoV projection (FFP) to mimic the pinhole images. Both projections are shown effective in extracting knowledge from the source model. 
However, as the distinct projections make it less possible to directly transfer knowledge between domains, we then propose Reliable Panoramic Prototype Adaptation Module (RP^2AM) to transfer knowledge at both prediction and prototype levels. RP^2AM selects the confident knowledge and integrates panoramic prototypes for reliable knowledge adaptation. 
Moreover, we introduce Cross-projection Dual Attention Module (CDAM), which better aligns the spatial and channel characteristics across projections at the feature level between domains. 
Both knowledge extraction and transfer processes are synchronously updated to reach the best performance. Extensive experiments on the synthetic and real-world benchmarks, including outdoor and indoor scenarios, demonstrate that our 360SFUDA++ achieves significantly better performance than prior SFUDA methods. Project Page: <https://vlislab22.github.io/360SFUDA/>




Source-Free Unsupervised Domain Adaptation, Panoramic Semantic Segmentation




§ INTRODUCTION



The comprehensive scene perception capabilities afforded by 360^∘ cameras have rendered them exceedingly popular for a diverse array of applications, including autonomous driving and virtual reality <cit.>. Unlike pinhole cameras, which capture 2D planar images within a confined field-of-view (FoV), 360^∘ cameras provide an expansive FoV spanning 360^∘× 180^∘. Consequently, there has been a concerted research endeavors towards panoramic semantic segmentation <cit.>, aiming at achieving comprehensive scene understanding for intelligent systems.




Generally, data captured by 360^∘ cameras in spherical form is commonly projected onto 2D planar representations, such as the Equirectangular Projection (ERP), to integrate seamlessly into existing imaging pipelines <cit.>, while still preserving omnidirectional information[Throughout this paper, the terms "omnidirectional" and "panoramic" are used interchangeably, with ERP images often denoting panoramic images.].
However, ERP images always suffer from the inevitable distortion and object deformation due to the non-uniformly distributed pixels <cit.>. Meanwhile, learning effective panoramic segmentation models is often hindered by the lack of large precisely labeled datasets due to the difficulty of annotation. 
For these reasons, some unsupervised domain adaptation (UDA) methods <cit.> have been proposed to transfer the knowledge from the pinhole image domain to the panoramic image domain. In some crucial application scenarios, , autonomous driving, source datasets are not always accessible due to privacy and commercial issues, such as data portability and transmission costs. A notable example is the recent large-scale model, SAM <cit.>, which has made significant advancements in instance segmentation for pinhole images. However, the size of the source datasets (10TB) renders them impractical for reuse in downstream tasks <cit.>.

In this paper, we probe an interesting yet challenging problem – source-free UDA (SFUDA) for panoramic segmentation, in which only the source model (pretrained with pinhole images) and unlabeled panoramic images are available. As shown in Fig. <ref> (b), different from existing SFUDA methods, , <cit.> for the pinhole-to-pinhole image adaptation, transferring knowledge from the pinhole-to-panoramic image domain is hampered by:
 1) semantic mismatches arising from the disparate FoV between pinhole and 360^∘ cameras, namely 70^∘ vs. 360^∘; 
2) inevitable inherent distortion of the ERP; 
3) style discrepancies caused by the distinct camera sensors and captured scenes. In Tab. <ref>, we demonstrate that simply applying existing SFUDA methods to the specific pinhole-to-panoramic adaptation problem yields only marginal performance enhancements.


To this end, we propose 360SFUDA++ that effectively extracts knowledge from the source pinhole model with only unlabeled panoramic images and transfers the reliable knowledge to the target panoramic domain.
Our key idea is to leverage the multi-projection versatility of 360^∘ data for efficient and reliable domain knowledge transfer.
360SFUDA++ enjoys two key technical contributions. 
Specifically, we leverage Tangent Projection (TP)[See Algorithm 2 in the supplementary material for tangent projection.] and divide the ERP images into patches with a fixed FoV, dubbed Fixed FoV Projection (FFP), to mimic pinhole images and extract knowledge from the source model, aiming at alleviating distortion and semantic mismatches between domains.
Both projection techniques enable efficient knowledge extraction from the source model.
Considering the distinct projections make it hardly possible to directly transfer the extracted knowledge to the target model, we introduce the reliable panoramic prototype adaptation module (RP^2AM) (Sec. <ref>) to achieve knowledge transfer at the prototype level (See Fig. <ref>). 
RP^2AM employs cross-projection prediction assessment (Sec. <ref>) to distinguish confident and uncertain pixels across three projections, extracting prototypes in the target panoramic domain (Sec. <ref>). The global prototypes from the source model with TP and FFP images are updated iteratively during adaptation to enhance knowledge extraction. Additionally, RP^2AM fine-tunes the source model using prototypes from FFP images to improve knowledge extraction (Sec. <ref>). Aligning prototypes from each FFP image enhances the model's awareness of distortion and semantics across the FoV.

For efficient knowledge adaptation, we apply prediction-level and prototype-level loss constraints to facilitate knowledge transfer to the unlabeled target panoramic domain (Sec. <ref>). FFP predictions are reconstructed as pseudo labels for the target model. Prototype-level loss constraints are enforced in both intra-projection and cross-projection prototypical adaptation. Intra-projection prototypical adaptation occurs between confident and uncertain prototypes obtained with ERP images. Cross-projection prototypical adaptation utilizes global panoramic prototypes extracted from TP and FFP images from the source model, continually updated throughout the adaptation process to supervise confident prototypes in the target domain.

Moreover, the knowledge derived from the source model goes beyond predictions and prototypes, encompassing high-level features that encapsulate crucial image characteristics, significantly enhancing the performance of the target model. To address this, we introduce the Cross-projection Dual Attention Module (CDAM) (Sec. <ref>), aiming at harmonizing spatial and channel characteristics across projections and domains, maximizing the utilization of knowledge from the source model and mitigating the style discrepancy problems. CDAM reconstructs source model features from FFP images to provide a panoramic understanding of the surrounding environment, aligning them with ERP features from the target model to facilitate effective knowledge transfer.

We conduct extensive experiments on both synthetic and real-world benchmarks, including outdoor and indoor scenarios.

We adapt the state-of-the-art (SoTA) SFUDA methods <cit.> – designed for pinhole-to-pinhole image adaptation – to our problem in addressing the panoramic semantic segmentation.
As shown in Fig. <ref>, the results show that our framework significantly outperforms these methods by large margins of +1.25%, +2.87%, and +3.09% on three benchmarks. 
We also evaluate our method against UDA methods <cit.>, using source data, the results demonstrate its comparable performance.

In summary, our main contributions are as follows: (I) we propose 360SFUDA++, which incorporates RP^2AM and CDAM to address the challenging source-free UDA task from pinhole to panoramic images; (II) The RP^2AM is proposed to achieve the panoramic knowledge adaptation with reliable prototypes between domains; (III) CDAM aims to harmonize spatial and channel characteristics across different projections of sphere data, aiming at mitigating the style discrepancy problem. (IV) Extensive experiments are conducted on both synthetic and real-world benchmarks (including indoor and outdoor scenarios) demonstrate the superiority of our 360SFUDA++. 



This work is an improvement over our CVPR 2024 work <cit.>, achieved by substantially extending the method and experiment in the following ways.
(I) We introduced the cross-projection pixel-wise prediction assessment in RP^2AM to discern confident and uncertain predictions for better knowledge adaptation (Sec. <ref>); 
(II) We upgraded the prototype extraction to cross-projection prototype extraction to obtain confident and uncertain prototypes for better knowledge transfer (Sec. <ref>); 
(III) We added the loss constraints between uncertain and confident prototypes to achieve intra-projection knowledge adaptation (Sec. <ref>);
(IV) We aligned the confident prototypes with the global panoramic prototypes for accurate and reliable prototypical knowledge adaptation (Sec. <ref>); 
(V) We conducted more comparison experiments between the new framework and the previous version, as well as the existing SoTA SFUDA methods (Sec. <ref>); 
(VI) We validated the effectiveness of the introduced strategies and components with extensive quantitative and qualitative analysis (Sec. <ref>).





§ RELATED WORK



 §.§ Source-free UDA for Segmentation

UDA aims to mitigate the impact of domain shift caused by data distribution discrepancies in downstream computer vision tasks, such as semantic segmentation <cit.>. However, the source domain data may not always be accessible due to the privacy protection and data storage concerns. Intuitively, source-free UDA (SFUDA) <cit.> methods are proposed to adapt source models to a target domain without access to the source data. 
Existing source-free UDA methods can be categorized into two distinct approaches: those generating images independently of the source data, and those employing self-supervision techniques with target pseudo-labels. <cit.>.
For instance, <cit.> introduces a dual-branch collaborative learning framework for SFUDA which separate target data into confident samples and uncertain samples to figure out unreliable pixel-wise segmentation. 
In this paper, we attempt to achieve SFUDA from the pinhole image domain to the panoramic image domain. This task is nontrivial to be tackled due to the semantic mismatches, style discrepancies, and inevitable distortion of panoramic images <cit.>.
Unlike these methods that focus on the source domain data estimation <cit.>, we propose 360SFUDA++, a novel SFUDA framework that effectively extracts knowledge from the source model with only panoramic images and transfers the knowledge to the target panoramic image domain. Different from the prior prototypical adaptation methods, such as  <cit.> which only focuses the confident and unreliable problem at sample level, our 360SFUDA++ subtly utilize the multi-projection versatility of panoramic data and achieve reliable prototypical adaptation in the pixel-level.
Experiments also show that naively applying these methods leads to less optimal performance (See Tab. <ref>).



 §.§ UDA for Panoramic Semantic Segmentation

It can be classified into three types, including adversarial training <cit.>, pseudo labeling <cit.> and prototypical adaptation methods <cit.>. Specifically, the first line of research applies alignment approaches to capture the domain invariant characteristics of images <cit.>, feature <cit.> and predictions <cit.>. The second type of method generates pseudo labels for the target domain training. The last line of research, , Mutual Prototype Adaption (MPA) <cit.>, utilizes the prototypical adaptation and mutually aligns the high-level features with the prototypes between domains. However, these methodologies often treat panoramic images as pinhole images during prototype extraction and adaptation, thereby neglecting the nuanced semantic details, object correspondences, and distortion inherent in panoramic FoV. In this paper, we address the SFUDA problem for panoramic segmentation by improving our previous work 360SFUDA <cit.>.
Considering the distinct projection discrepancies between source and target domains, we propose an RP^2AM to transfer knowledge at the prototype level. Differently, we take the cross-projection pixel-wise predictions' confidence into consideration and further extract reliable prototypes for better knowledge adaptation. 




§ METHODOLOGY
   


 §.§ Overview

The overall framework of our 360SFUDA++ is shown in Fig. <ref>. 
Given only the source model F_S and unlabeled panoramic image data D_T, the SFUDA objective is to learn a target model F_T that effectively transfers knowledge from F_S to the common K categories across both domains.
Different from the traditional pinhole image-to-image adaptation <cit.>, the knowledge adaptation from pinhole to panoramic image domains is notably challenged by three primary factors, specifically:
1) semantic mismatch between pinhole and panoramic images caused by the FoV variations (70^∘ vs. 360^∘), which means there are more objects and cross-object correlations in panoramic images with 360^∘ FoV; 
2) inevitable distortion and deformation in ERP of panoramic images; and 3) ubiquitous style discrepancies in almost all UDA tasks.

Therefore, naively applying existing SFUDA methods exhibits sub-optimal segmentation performance (See Tab. <ref>), while UDA methods with source data, , <cit.> for panoramic segmentation fail to address the semantic discrepancies between the pinhole and panoramic images. Intuitively, the key challenges are
: 1) how to extract knowledge from the source pinhole model with only unlabeled panoramic images and 2) how to efficiently transfer knowledge to the target panoramic image domain. Overall, in our 360SFUDA++, the key idea is to leverage the multi-projection versatility of 360^∘ data for efficient domain knowledge transfer.

To tackle the first challenge (Sec. <ref>), we utilize the Tangent Projection (TP) which is distinguished by its ability to mitigate distortion problems more effectively than ERP images <cit.>, leveraging the reduced distortion characteristics of TP to extract knowledge from the source pinhole model. Concurrently, we segment ERP images into discrete patches, each possessing a constant FoV to mimic the pinhole images, dubbed Fixed FoV Projection (FFP). Both TP and FFP facilitate the effective extraction of knowledge from the source model. However, the inherent differences in projection formats preclude a direct transfer of knowledge between domains. To overcome this obstacle, we introduce the Reliable Panoramic Prototype Adaptation Module (RP^2AM), designed to generate panoramic prototypes suitable for knowledge adaptation.
To address the second challenge (Sec. <ref>), we first impose prediction and prototype level loss constraints, and propose a Cross-Dual Attention Module (CDAM) at the feature level to transfer knowledge and further address the style discrepancies between pinhole and panoramic images.



 §.§ Knowledge Extraction


As illustrated in Fig. <ref>, given the unlabled target domain (, panoramic domain) ERP images D_T={x_T|x_T ∈𝐑^H× W× 3}, we first project them into TP images D_T^t={x_T^t|x_T^t∈𝐑^h× w× 3} and FFP images D_T^f={x_T^f|x_T^f∈𝐑^H× W/4× 3}. Note that one ERP image corresponds to 18 TP images as  <cit.> and 4 FFP images with a fixed FoV of 90^∘ (ablation can be found in Sec. <ref>).
To obtain the high-level features and predictions from the source model for knowledge adaptation, TP and FFP images are first fed into the source model with batch sampling:

    P^p, f^p =F_S(x_T^t),      P^f, f^f =F_S(x_T^f),

where f^p, f^f, P^p, and P^f are the source model features and predictions of the input TP and FFP images, respectively. 
For the target domain panoramic images, x_T is fed into F_T to obtain the target model features f and predictions P of the input batch of ERP images as P, f = F_T(x_T).
To overcome inherent differences caused by the projection formats, we introduce the Reliable Panoramic Prototype Adaptation Module (RP^2AM) to obtain panoramic prototypes for effective and reliable knowledge adaptation.  







  §.§.§ Reliable Panoramic Prototype Adaptation Module


In contrast to the previous version of this work <cit.>, namely panoramic prototype adaptation module (PPAM), which posses three distinct characteristics, including: (a) class-wise prototypes are obtained from distinct projections directly to achieve knowledge transfer; (b) global prototypes are iteratively updated across training; and (c) hard pseudo labels are softened in the feature space to take full use of the source knowledge. 
Deviating from the previous work <cit.>, we put forward a better prototypical adaptation strategy with more reliable knowledge extraction and transfer. 



Compared to prior UDA and SFUDA methods using prototypical adaptation, , CFA <cit.>, MPA <cit.> and our previous PPAM <cit.>, our RP^2AM possesses two distinct characteristics: 
(a) cross-projection prototypical adaptation is conducted between ERP and the other two projections, , TP and FFP, aiming at alleviating the distortion and semantic mismatch problems; and
(b) intra-projection prototypical adaptation is performed with ERP and FFP, aiming to achieve reliable prototypical adaptation for the ERP and distortion-aware ability for the FFP.
Specifically, we first project the source model predictions P^p, P^f into pseudo labels: 

    ŷ^p_(h,w,k) = 1_k ≐ argmax(P^p_h,w,:) ,     
       ŷ^f_(H,W/4,k) = 1_k ≐ argmax(P^f_H,W/4,:) ,

where k denotes the semantic category. Subsequently, we propose the cross-projection pixel-wise prediction assessment to select the confident predicted pixels across three projections.



  §.§.§ Cross-projection Pixel-wise Prediction Assessment


As shown in Fig. <ref>, we transfer all the prediction maps from different projections into the ERP image (, 400 × 2048 in DensePASS) by merging the FFP and applying transformation function f_T2E(·) as <cit.> to TP images. Then, for each pixel coordinate (i,j), a comparative evaluation of the prediction logits P_(i,j), P_(i,j)^f, and P_(i,j)^p is conducted to distinguish confident from uncertain pixel predictions. Specifically, a pixel (i,j) is deemed confident if the condition P_(i,j) = P_(i,j)^f = P_(i,j)^p holds, signifying concordance in the prediction outputs across the varied projections for P_(i,j). This allows for building up a confident pixel map from pixels, such as P_(i,j). Conversely, the pixels with different predictions are defined as uncertain pixels, facilitating the generation of an uncertain pixel map. 




  §.§.§ Cross-projection Prototype Extraction


We then utilize the predicted maps as masks to get the confident and uncertain predictions P_con and P_un which are used to attain the confident and uncertain prototypes for ERP images. P_con and P_un are first converted to pseudo labels as the same operations in Eq. <ref>. Then we up-sample the ERP features f to fit the spatial size as P_con and P_un. The uncertain and confident prototypes τ_un and τ_con for ERP images are achieved by masked average pooling (MAP) operation, as shown in Fig. <ref>. To realize the intro-projection prototypical knowledge adaptation from the reliable pixels to the uncertain pixels, the Mean Squared Error (MSE) loss is imposed between the reliable and uncertain prototypes as follows:

    ℒ_un = ∑_α≠β^4{1/K∑_k ∈ K(τ_con - τ_un)^2}.


Subsequently, class-specific masked features are derived by amalgamating the up-sampled features with their corresponding pseudo labels, denoted as ŷ^p_(h,w,k) for TP and ŷ^f_(H,W/4,k) for FFP images. 
It is noteworthy that the prototypes for TP and FFP images, represented as ∑_a=1^18 (τ_p^k)_a and ∑_b=1^4 (τ_f^k)_b respectively, are acquired through the MAP operation, as depicted in Fig. <ref>. Within each projection, RP^2AM first integrates the prototypes:

    τ_p^k = avg(∑_a=1^18 (τ_p^k)_a),     τ_f^k = avg(∑_b=1^4 (τ_f^k)_b).

As shown in Fig. <ref>, τ_p^k and τ_f^k are integrated together as τ_pf^k to retain the less distortion characteristics inherent τ_p^k and the similar scale semantics of τ_f^k. The τ_pf^k is then used to update the panoramic global prototype τ_g^k, which is iteratively updated with τ_pf^k. To obtain more accurate and reliable prototypes, we update τ_g^k and τ_pf^k as follows:

    τ_g^i = 1/i(τ_pf^k)^i + (1 - 1/i)(τ_g^k)^i-1,

where (τ_g^k)^i and (τ_pf^k)^i are the prototypes for category k in the i-th training epoch, (τ_g^k)^i-1 is the panoramic global prototype saved in the last training epoch, i is the current epoch number.
The panoramic global prototype τ_g^k is then used to give supervision for the confident prototype τ_con obtained from Sec. <ref>, as shown in Eq. <ref>.



  §.§.§ Fine-tuning Source Model for Better Knowledge Extraction


Besides extracting prototypical knowledge from the source model, RP^2AM also fine-tunes the source model to improve the effectiveness of knowledge extraction. 
Given that each ERP image is converted to four FFP image patches with the same FoV, the source model consequently extracts four distinct sets of FFP features, denoted as f_f. Considering that these features originate from the same ERP image, we synchronize the class-wise prototypes across each set of FFP features, thereby enhancing the source model's overall performance and distortion awareness. Specifically, the prototypes ∑_α=1^4 τ_α of the four FFP features are obtained through the same operations with τ_g^t. 

Each FFP image encapsulates a unique, non-overlapping 90^∘ FoV, presenting distinct levels of distortion and overlapping semantic content across the different FFP images. The alignment of prototypes corresponding to each FFP image not only bolsters the source model's capability to recognize and adapt to the distortion but also facilitates the exploration of complementary semantic content inherent within each FFP image patch. 



Thus, the MSE loss is imposed between each two of the prototypes, formulated as follows:

    ℒ_sft = ∑_α≠β^4{1/K∑_k ∈ K((τ_f^k)_α-(τ_f^k)_β)^2}.

Note that ℒ_sft is only used to fine-tune the source model F_S.





 §.§ Knowledge Adaptation


To facilitate the adaptation of knowledge to the target domain, we first enforce loss constraints on both predictions and prototypes. Moreover, we introduce a Cross-Dual Attention Module (CDAM) at the feature level. This module is designed to enhance the alignment of both spatial and channel characteristics across domains and projections. The CDAM leverages attention mechanisms <cit.> to adjust and synchronize feature representations, thereby improving the congruence between the source and target domains. This strategic incorporation of spatial and channel attention statistics within CDAM bridges the domain-specific discrepancies, ensuring a more effective and nuanced knowledge transfer.



Specifically, the FFP image patches are stitched to reconstruct an ERP image. It is then passed to the source model F_S to predict a pseudo label, which is employed to supervise the ERP predictions of the target model F_T. For simplicity, we use the Cross-Entropy (CE) loss, which is formulated as:

    ℒ_sup = CE(P, 1_k ≐ argmax({Rebuild(P^f_H,W/4,:)}) ).

The prototype-level knowledge transfer loss is achieved by MSE loss between the panoramic global prototype τ_g^k and the confident prototype τ_con^k from ERP images:

    ℒ_ppa = 1/K∑_k ∈ K(τ_g^k-τ_con^k)^2.

With loss ℒ_ppa, the reliable prototypes are pushed together to transfer the knowledge extracted from the source domain to the target domain.
In summary, with the proposed RP^2AM, we can effectively address the distortion and semantic mismatch problems at the prediction and prototype levels. We now tackle the style discrepancy problem at the feature level.

Cross-projection Dual Attention Module (CDAM).

Inspired by the dual attention <cit.>, focusing on spatial and channel characteristics, our CDAM imitates the spatial and channel-wise distributions of cross-projection features to alleviate the style discrepancies in UDA for panoramic semantic segmentation. 
Different from the basic dual attention in <cit.> which minimizes the distribution distance of the dual attention maps between the fake source and target data, our CDAM focuses on directly aligning the distribution between FFP and ERP of the same panoramic images rather than introducing additional frameworks or parameters to estimate fake source data as proxy.

As shown in Fig. <ref>, we reconstruct the FFP features F^f to ensure that the rebuilt feature F' has the same spatial size as F. Before the cross dual attention operation, we apply a Batch Normalization Statics (BNS) guided constraint on F and F'. Since the BNS of the source model should satisfy the feature distribution of the source data, we align F and F' with BNS to alleviate the domain gaps as follows:

    ℒ_bns =    || μ(F) - μ̅||_2^2 + || σ^2(F) - σ̅^2||_2^2  
       + || μ(F') - μ̅||_2^2 + || σ^2(F') - σ̅^2||_2^2,

where μ̅ and σ̅^2 are the mean and variance parameters of the last BN layer in the source model S.



As shown in Fig. <ref>, after aligned with BNS, the ERP feature f and the rebuilt feature f' are first reshaped to be f ∈ℝ^N × C and f' ∈ℝ^N × C, where N is the number of pixels and C is the channel number. Then we calculate the spatial-wise attention maps M_sp∈ℝ^N × C and M'_sp∈ℝ^N × C for f and f' by:

    {M_sp}_ji = exp(f'_[i:]· f_[:j]^T)/∑_i^N exp(f'_[i:]· f_[:j]^T),     
       {M_sp'}_ji = exp(f_[i:]·f'_[:j]^T)/∑_i^N exp(f_[i:]·f'_[:j]^T),

where f^T is the transpose of f and {M}_ij measures the impact of the i-th position on the j-th position. 
Similarly, the channel-wise attention maps M_ch∈ℝ^C × C and M'_ch∈ℝ^C × C 
can be obtained through:

    {M_ch}_ji = exp(f'_[i:]^T · f_[:j])/∑_i^C exp(f'_[i:]· f_[:j]^T),     
       {M_ch'}_ji = exp(f_[i:]^T ·f'_[:j])/∑_i^C exp(f_[i:]^T ·f'_[:j]).

After obtaining the spatial and channel attention maps, the CDAM loss can be calculated with the Kullback-Liibler divergence (, KL divergence) as follows:

    ℒ_cda = KL(M_sp, M_sp') + KL(M_ch, M_ch')








 §.§ Optimization

The overall optimization procedure is shown in Algorithm. <ref>. The training objective for learning the target model containing three losses is defined as:

    ℒ = ℒ_un + ℒ_ppa + γ·ℒ_cda + ℒ_bns + ℒ_sup

where ℒ_ppa is the MSE loss from RP^2AM, ℒ_cda refers to the KL loss from CDAM, ℒ_sup denotes the CE loss for the prediction pseudo label supervision loss, ℒ_bns refers to the BNS guided feature loss, and λ and γ are the trade-off weights of the proposed loss terms. 










§ EXPERIMENTS AND ANALYSIS


We empirically validate our method by comparing it with the existing SFUDA, UDA, and panoramic segmentation methods on three widely used benchmarks.



 §.§ Datasets and Implementation Details.


(1) Cityscapes-to-DensePASS (C-to-D): Cityscapes <cit.> constitutes a comprehensive real-world dataset meticulously collected for autonomous driving applications, encompassing street scenes sourced from 50 distinct cities. It offers precise pixel-wise annotations across 19 semantic categories. The dataset's official split includes 2975 images for training and 500 images for validation. In this study, we leverage the official training set (2975 images) as the source domain data for acquiring the pre-trained source model. DensePASS <cit.>, on the other hand, is a panoramic dataset tailored to capture diverse street scenes worldwide, comprising 2500 panoramas. Within this collection, a subset of 100 panoramas has been meticulously annotated with a high degree of precision, targeting categories that are crucial for navigation. This subset is designated as the test set for evaluation purposes. In the context of C-to-D scenario, we employ the DensePASS training set as the unlabeled target panoramic data.

(2) SynPASS-to-DensePASS (S-to-D): SynPASS <cit.> emerges as a synthetic dataset composed of 9080 synthetic panoramic images meticulously annotated across 22 categories. Its official sets for training, validation, and testing encompass 5700, 1690, and 1690 images, respectively. For training and testing purposes, we concentrate on the subset of 13 categories that SynPASS and DensePASS datasets have in common for both training and evaluation purposes. This setup allows us to explore the nuances of transferring knowledge from synthetic (SynPASS) to real-world data (DensePASS), treating SynPASS as the synthetic source dataset and DensePASS as the real-world target dataset.

(3) Stanford2D3D-pinhole-to-panoramic (SPin-to-SPan): The Stanford2D3D Pinhole (SPin) dataset comprises 70496 pinhole images annotated across 13 semantic categories. Conversely, the Stanford2D3D Panoramic (SPan) dataset consists of 1413 indoor panoramic images. These images are preciesely annotated with identical 13 semantic categories as observed in the pinhole dataset <cit.>. In this paper, our focus narrows to the 8 semantic categories that are common across both subsets.

Implementation Details. We train our frameworks with 4 NVIDIA GPUs with an initial learning rate of 6e^-5, which is scheduled by the poly strategy with power 0.9 over 200 epochs. The optimizer is AdamW with epsilon 1e^-8, weight decay 1e^-4, and batch size is 4 on each GPU. The adaptation frameworks are trained within 10K iterations. With respect to input resolutions, training images from indoor pinhole cameras and panoramic views are processed at resolutions of 1080 × 1080 and 1024 × 512, respectively. In the SynPASS-to-DensePASS (S-to-D) scenario, synthetic panoramic images maintain a resolution of 1024 × 512. For outdoor scenarios, pinhole and synthetic panoramic images are adjusted to 1024 × 512, whereas real-world panoramic images are presented at 2048 × 400. The resolutions for validation image sets in indoor and outdoor environments are set to 2048 × 1024 and 2048 × 400, respectively, to ensure uniformity in the evaluation framework.





 §.§ Experimental Results.


Initially, we undertake a comprehensive evaluation of the proposed 360SFUDA++ framework within the C-to-D scenario. Outcomes, including both qualitative and quantitative analyses, are presented in Fig. <ref> and Tab. <ref>, demonstrating the framework's adaptation capabilities across urban panoramas. 360SFUDA++ demonstrates superior performance relative to the previous version 360SFUDA and other source-free UDA methods <cit.>. Remarkably, it also achieves panoramic semantic segmentation performance that are comparable to those of UDA methods that leverage source domain imagery during the adaptation process, such as Trans4PASS <cit.> (52.99% vs. 53.18%). Our 360SFUDA++ model yields substantial improvements, with mIoU increases of +1.41% and +2.87% using SegFormer-B1 and -B2 backbones, surpassing our previous version, 360SFUDA, and significantly outperforming SFUDA methods SFDA <cit.> and DATC <cit.> by +7.49% and +7.13% in mIoU, respectively. The qualitative results are shown in the Fig. <ref>, vividly illustrating our 360SFUDA++'s superior capability in handling complex segmentation tasks.
We also provide the TSNE visualization to further show the superiority of our 360SFUDA++ in Fig. <ref>, apparently, our 360SFUDA++ gains a significant improvement in distinguishing the pixels in panoramic images in both prediction and the high-level representation spaces.

Subsequently, we conduct an evaluation of our 360SFUDA++ framework within the S-to-D scenario. The outcomes of this assessment are detailed in  Tab. <ref> and Fig. <ref>. 
Apparently, our 360SFUDA++ significantly outperforms the source-free UDA methods <cit.> by a large margin and 360SFUDA++ improves the previous version <cit.> by +0.75 and +1.25 mIoU with SegFormer-B1 and -B2 backbones, respectively. 
The results affirm that our 360SFUDA++ framework, augmented by RP^2AM and CDAM, is particularly adept at facilitating robust and efficacious knowledge transfer across domains for panoramic semantic segmentation. Moreover, the performance of 360SFUDA++ in key categories pertinent to driving—such as ‘person' (54.60% mIoU), ‘rider' (30.76% mIoU), and ‘car' (79.41% mIoU)—exemplifies its superior capability in semantic segmentation within critical traffic-related contexts. Additionally, the t-SNE visualization presented in Figure <ref> further elucidates the effectiveness of 360SFUDA++ in cultivating a distinctive and informative representation space, underscoring its overall proficiency in domain adaptation for panoramic imaging tasks.
 
Lastly, we evaluate our 360SFUDA++ on the Spin-to-Span scenario can compare it with our previous 360SFUDA <cit.> and SFDA <cit.> methods, as well as the UDA methods, such as MPA <cit.>. As illustrated in Tab. <ref>, 360SFUDA++ significantly outperforms the source-free method SFDA <cit.> by +11.78% mIoU. Notably, 360SFUDA++ even outperforms the UDA methods using source data in the adaptation (68.84% vs. 67.16% mIoU). The visualization results in Fig. <ref> also demonstrate the superiority of our 360SFUDA++. Additionally, t-SNE visualizations highlight 360SFUDA++'s enhanced capability for distinguishing features within high-level representation spaces, reaffirming its effectiveness in domain adaptation for panoramic semantic segmentation. More quantitative comparison and visualization results refer to the supplementary material.





§ ABLATION STUDY




 §.§ Different Loss Function Combinations.

Tab. <ref> evaluates the influences of all the proposed loss functions in 360SFUDA++, including ℒ_sup, ℒ_un, ℒ_ppa, ℒ_sft, ℒ_cda, and ℒ_bns. Building upon the foundational loss functions introduced in <cit.>, 360SFUDA++ innovatively integrates ℒun to facilitate local prototypical knowledge transfer from reliable to uncertain pixels within target panoramic imagery. Moreover, it refines ℒppa through the application of MSE between the global panoramic prototype and the confident prototype extracted from ERP images. As delineated in Tab. <ref>, all the proposed loss functions have a positive impact on improving the overall panoramic semantic segmentation performance. 
Noteworthy is the RP^2AM, leveraging ℒun and ℒppa, which secures substantial improvements of +12.40% and +5.15% in mIoU, underscoring the module's efficacy in optimizing knowledge extraction and adaptation processes. Furthermore, the CDAM exerts a favorable influence on segmentation outcomes, evidencing increments of +5.59% and +2.57% mIoU across C-to-D and S-to-D scenarios, respectively.
 These results affirm CDAM's success in replicating spatial and channel-level feature distributions between ERP and FFP images, effectively mitigating stylistic disparities across domains.



 §.§ Ablation Study of RP^2AM


PPAM vs. RP^2AM.
In order to ascertain the efficacy of the proposed RP^2AM in comparison to PPAM delineated in our previous work  <cit.>, we conduct ablation experiments and provide the visualization of loss curves of PPAM and RP^2AM on the C-to-D scenario. The results are shown in Fig. <ref>. The graphical representation clearly illustrates that, although RP^2AM's loss trajectory experiences more pronounced fluctuations during the initial stages of training, it eventually achieves a more favorable convergence compared to PPAM throughout the training duration. This observation underscores RP^2AM's superior capacity for stable and effective learning, marking a significant advancement over PPAM.



Effectiveness of the Confidence Maps
To substantiate the efficacy of the cross-projection pixel-wise prediction assessment employed within the RP^2AM, we present visualizations of confidence maps throughout the training process, as illustrated in Fig. <ref> (a). These visualizations reveal a progressive increase in the prevalence of white pixels within the confidence maps, symbolizing a growth in the number of pixels deemed confident. Concurrently, quantitative analyses, as detailed in Tab. <ref>, corroborate that the implementation of reliable prototypical adaptation in 360SFUDA++ leads to considerable performance enhancements over the framework's preceding iteration detailed in <cit.>. This convergence of qualitative and quantitative evidence firmly establishes the beneficial impact of employing confidence maps for improved pixel-wise prediction accuracy in panoramic semantic segmentation tasks.







 §.§ Ablation Study of CDAM

Dual Attention vs. Cross Dual Attention.
The dual attention (DA) approach proposed in SFDA <cit.> aligns the spatial and channel characteristics of features between the fake source and target data. In contrast, our cross dual attention (CDA) approach aligns the distribution between different projections of the same spherical data, specifically ERP and FFP, resulting in more robust and stable knowledge transfer. Moreover, in our CDA, we obtain spatial and channel characteristics across features from different projections, whereas DA operates within features. We compare DA and our cross-projection DA on the C-to-D scenario, our method achieves 44.24% mIoU, while DA only reaches 41.53% mIoU. This empirical evidence suggests that our cross-projection DA offers a more adept solution for addressing the challenges inherent in SFUDA for panoramic semantic segmentation tasks.

FoV Selection of FFP.
The integration of distortion-aware mechanisms and innovative projection techniques has been extensively investigated within the scope of panoramic semantic segmentation in existing literature, such as <cit.> and Zheng et al. <cit.>. Nonetheless, as delineated in Sec. <ref>, the complex semantic content and object relationships inherent in 360-degree imagery precipitate a pronounced semantic incongruity across different domains. Intuitively, we introduce the Fixed FoV Projection (FFP) strategy to address the aforementioned problem. The quantitative results in Tab. <ref> show that the FoV of 90^∘ achieves the best panoramic segmentation performance of 44.28% mIoU. This finding underscores the effectiveness of the FFP strategy in mitigating domain-specific semantic discrepancies in panoramic domain.








































Ablation of γ.

We study the sensitivity of hyper-parameter γ, which are the trade-off weights for the KL loss in CDAM. The quantitative results are provided in Tab. <ref>.



§ DISCUSSION


Fine-tuning the Source Model.
In the context of domain adaptation, the process of transferring knowledge from a pre-trained source model to a target domain presents notable challenges. The intrinsic discrepancies between the source pinhole domain and the target panoramic image domain necessitate a tailored approach for model adaptation. To this end, we advocate for the refinement of the pre-trained source model utilizing a specialized fine-tuning loss, denoted as ℒ_sft. This is predicated on the observation that a model pre-trained in the source domain may not inherently exhibit optimal performance within the target domain.
 
The results presented in Tab. <ref> substantiates the efficacy of the proposed fine-tuning loss ℒ_sft in enhancing model performance. Further insight is afforded by the TSNE visualizations depicted in Fig. <ref> (b), which contrast the performance of the source model before and after fine-tuning on both source and target domain data. These visualizations compellingly illustrate that fine-tuning with unlabeled target data not only elevates the model's effectiveness within the target domain but also augments its capacity for pixel-wise feature differentiation in the source domain. This nuanced approach underscores the importance of fine-tuning pre-trained models with domain-specific adaptations to bridge the gap between disparate domains, thereby improving model generalizability and performance across different modalities.

Difference between Pinhole-to-Panoramic and Pinhole-to-Pinhole UDA.
In the context of SFUDA, the primary challenge arises from the domain shift attributable to style discrepancies, which stem from differing data distribution between the source and target domains. However, when the objective is to adapt models from the conventional pinhole camera domain to the domain of panoramic images, one encounters additional complexities. As evidenced by the results in Tba. <ref>, endeavors have been made for adaptation within the pinhole camera domain <cit.> tend to offer marginal improvements in performance when bechmarked against a standard baseline. This phenomenon is largely due to the more intricate nature of domain shift that occur in the transition from pinhole to panoramic adaptation scenarios, a topic elaborated upon in Sec. <ref>. By integrating our proposed modules, , RP^2AM and CDAM, the performance has been largely improved by +6.08% and +5.72% performance gain over SFDA <cit.> and DATC <cit.>, respectively.






§ CONCLUSION AND FUTURE WORK

In this paper, we explored the challenging source-free unsupervised domain adaptation from pinhole to panoramic image domain. To this end, we proposed a novel framework for panoramic semantic segmentation, namely 360SFUDA++, to address the domain shifts between pinhole and panoramic images, including semantic mismatch, inevitable distortion, and inherent style discrepancies. We subtly utilized the multi-projection versatility of 360^∘ data for efficient and reliable domain knowledge transfer. The RP^2AM is introduced to select the confident extracted knowledge and integrate panoramic prototypes for reliable knowledge adaptation. Meanwhile, we proposed CDAM to better align the spatial and channel characteristics across projections at the feature level between domains. Extensive experiments on the synthetic and real-world benchmarks, including indoor and outdoor scenarios, show that our 360SFUDA++ outperforms prior approaches and is on par with the UDA methods using the source data.

Future Work:
In future research, we intend to employ Large Language Models (LLMs) and Multi-modal Large Language Models (MLLMs) to address the domain discrepancies, specifically targeting semantic mismatches between pinhole and panoramic images. This approach aims to enhance the interpretative alignment and integration across the different projection of spherical data. Also, the Segment Anything Model (SAM) can be applied to unleash its powerful zero-shot instance segmentation ability.








    IEEEtran
    














