Downloads · 30 days
3
8% of all-time downloads
J1gA/zernike-cnn-v8-1.4
zernike-cnn-v8-1.4 is a image feature extraction model from J1gA. Use it for the image feature extraction task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
EfficientNet-B2 (PyTorch + timm), восстанавливает 14 коэффициентов Цернике (OSA-нумерация Z1…Z14, радианы) из пары PSF (phase diversity).
Downloads · 30 days
3
8% of all-time downloads
All-time downloads
38
Public
Repo size
93.4 MB
Likes
0
Public
Click a slice to open those files.
.pt93.4 MB · 100%
From the Hugging Face model README
EfficientNet-B2 (PyTorch + timm), восстанавливает 14 коэффициентов Цернике (OSA-нумерация Z1…Z14, радианы) из пары PSF (phase diversity).
uint16 → sqrt-нормировка → 2-канальный тензорweighted_noll (1/σ²_Noll по каждой моде)| Тест | MAE/коэф., рад | WF RMS, рад | Strehl |
|---|---|---|---|
| Колмогоров D/r₀ ∈ [0.5, 20] | 0.0092 | 0.050 | 0.997 |
| Closed-loop (D/r₀=5, 15 итер., gain=0.4) | — | 0.034 | 0.999 |
На равномерно распределённых аберрациях U[−6,+6] на каждую моду —
ломается (MAE ≈ 3.95 рад). Для лабораторных задач использовать
вторую модель zernike-cnn-v8-2.0-def1_5.
from huggingface_hub import hf_hub_download
import torch, timm, torch.nn as nn
ckpt_path = hf_hub_download(
repo_id="YOUR_USERNAME/zernike-cnn-v8-1.4",
filename="best_model.pt"
)
class ZernikeModel(nn.Module):
def __init__(self, num_outputs=14):
super().__init__()
self.backbone = timm.create_model(
"efficientnet_b2", pretrained=False, in_chans=2, num_classes=0
)
self.head = nn.Sequential(
nn.Linear(self.backbone.num_features, 256),
nn.SiLU(),
nn.Dropout(0.1),
nn.Linear(256, num_outputs),
)
def forward(self, x):
return self.head(self.backbone(x))
model = ZernikeModel().eval()
ckpt = torch.load(ckpt_path, map_location="cpu", weights_only=True)
state = ckpt.get("model_state_dict", ckpt)
model.load_state_dict(state)