patchdist_fit — SPC anomaly_patch op

• 資料種類:video → table

• 呼叫: import fullseye as fs; fs.ledger.patchdist_fit(stack, patch=8, stride=4, scales=(1.0, 2.0, 4.0), groups=('gradient', 'gabor', 'lbp'), n_orient=4, shrinkage='auto', n_dims=None, seed=0, ridge=1e-06, pool='position')(要直接呼叫實作,import anomaly_patch; anomaly_patch.patchdist_fit(stack, patch=8, stride=4, scales=(1.0, 2.0, 4.0), groups=('gradient', 'gabor', 'lbp'), n_orient=4, shrinkage='auto', n_dims=None, seed=0, ridge=1e-06, pool='position');從台帳取用則 opsspc.get("patchdist_fit"))

用法

從良品影像學習每個網格位置上圖塊特徵的常態分佈(宣告收縮估計,共變異數奇異則拒絕)(table)。

> 以下的詳細說明為原文 —— 摘要與標題已翻譯。

stack is (n, H, W) or (n, H, W, 3) of good images, n >= 2, registered well enough that a grid cell sees the same content. The feature is patch_features (same parameters). At every cell the mean and the covariance (maximum likelihood, divided by n) of the D-dimensional feature are estimated; n <= D makes the covariance singular, so the shrinkage toward tr(S)/D * I is declared: "auto" is the Ledoit–Wolf analytic intensity per position, a number in (0, 1] fixes it, "none" (or 0) is accepted only when n - 1 >= D and the covariance is positive definite and otherwise refused. n_dims keeps a seeded random subset of the D dimensions (the memory trick of the original method), ridge (relative to the median variance, applied unless shrinkage="none") is a numerical floor against exactly constant channels. pool="position" (default) estimates one distribution per grid cell, right when the content is registered; pool="global" estimates ONE distribution from the patches of all cells and images (n * gh * gw samples, overlapping patches are not independent), right for a stationary texture whose content at a cell differs from image to image and which has far more samples than dimensions.

Returns the model: per-position mean and precision (inverse of the shrunk covariance), shrinkage_map and its mean shrinkage_mean, n_train, dim, dims (kept channels), the feature parameters and image_shape. Pass it to patchdist_score.

Raises ValueError for fewer than two images, a singular covariance with shrinkage="none", a constant feature that stays singular, or invalid parameters.

參考(範例資料、文獻)

• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。

• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。

• 演算法的正典(作者、年份)與用途見上面的族使用指南。

可執行的範例(實際呼叫該運算子並已驗證的樣例)

• poc_patch_anomaly — py -3.11 examples/poc_patch_anomaly.py

型別可銜接的下一個運算子(可接受 table 作為輸入)

msa_anova_table · msa_gauge_rr · msa_bias_linearity · msa_attribute_agreement · gum_standard_uncertainty · gum_propagate · gum_expanded · gum_monte_carlo

同類別(anomaly_patch)

patch_features · patchdist_score · patchbank_fit · patchbank_score


*Provenance: anomaly_patch.py — SPC 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.