印刷電路板(PCB)的瑕疵檢測是電子製造品質管控的關鍵環節,產線部署要求模型 同時具備高準確率與即時推論速度。然而卷積神經網路受限於局部感受野,難以捕捉全 域脈絡,Transformer 的自注意力機制在偵測微小瑕疵所需的高解析度輸入下計算成本又 過於高昂。本研究提出SSMLP-UNet,於窄化通道之輕量U-Net主幹(13.33M參數)的兩 個深層位置,嵌入空間位移稀疏多層感知機(Shifted Sparse MLP)模組。該模組以軸向投 影沿列與行方向進行全域特徵混合,並結合循環空間位移構成雙路徑設計,經 1×1 卷 積與可學習殘差權重α融合。兩個模組僅增加約 0.67M 參數,整體模型共 14.00M 參 數,於640×640影像輸入下達到44.2 FPS,滿足即時檢測需求。 在資料處理方面,本研究提出以影像差分結合閾值化、邊界框空間約束、連通元件 過濾與形態學閉運算之自動遮罩生成流程,將低成本的框選標註轉換為像素級標註,並 據我們所知首次於 DeepPCB 資料集建立多類別像素級語意分割基準。於 DeepPCB、 MeiweiPCB 與 PCB-Vision 三個特性互補之資料集上,以三組隨機種子進行驗證, SSMLP-UNet 之 mIoU 分別超越同量級以 Transformer 為主幹之對照模型 LRFormer-T 達9.78、3.09與13.21個百分點,並以不到一半的參數量達到或超越標準U-Net(29.06M)。 消融實驗進一步刻畫模組的作用,可學習融合相較固定相加,於 DeepPCB 與 MeiweiPCB 分別帶來0.71 與0.90 個百分點的增益,逐種子方向一致;有效感受野分析 顯示模組使感受野相較無模組主幹擴大4.62倍,並呈現軸向混合特有的十字形分佈。於 長距離裂縫分割任務的延伸實驗中,模組帶來三種子方向一致的增益(裂縫類別 IoU +1.44),支持全域混合能力在目標無法僅憑局部線索辨識時最具價值的詮釋。;Printed circuit board (PCB) defect inspection is a critical step in electronics manufacturing quality control, where production-line deployment demands both high accuracy and real-time inference. Convolutional networks are constrained by local receptive fields, whereas Transformer self-attention is prohibitively expensive at the high input resolutions required for detecting small defects. This thesis presents SSMLP-UNet, a lightweight semantic segmentation network that equips a narrow-channel U-Net backbone (13.33M parameters) with two Shifted Sparse MLP modules at its deep stages. The modules perform global feature mixing through axial projections along rows and columns, combined with a circular spatial shift in a dual-path design, fused by a 1×1 convolution and a learnable residual weight α. The two modules add only about 0.67M parameters, for a total of 14.00M, and the network runs at 44.2 FPS at 640×640 input, meeting real-time requirements. For data processing, an automated mask-generation pipeline based on an automated mask generation pipeline based on image differencing, bounding-box-constrained thresholding, connected-component filtering, and morphological closing operations converts low-cost bounding-box annotations into pixel-level masks, establishing, to the best of our knowledge, the first multi-class pixel-level segmentation benchmark on the DeepPCB dataset. Evaluated with three random seeds on three complementary datasets (DeepPCB, MeiweiPCB, and PCB Vision), SSMLP-UNet surpasses the same-weight-class Transformer baseline LRFormer-T by 9.78, 3.09, and 13.21 mIoU points, respectively, while matching or exceeding a standard U-Net (29.06M) with less than half the parameters. Ablation studies further characterize the role of the modules: the learnable fusion outperforms fixed addition by 0.71 and 0.90 mIoU on DeepPCB and MeiweiPCB with a consistent direction across all three seeds, and an effective receptive field analysis shows a 4.62× enlargement over the module-free backbone with the cross-shaped pattern characteristic of axial mixing. An extension to long-range crack segmentation yields a direction-consistent gain (+1.44 crack-class IoU over three seeds), supporting the interpretation that the global mixing is most valuable when targets cannot be resolved from local cues alone.