SCAF — Structural Conservation Adaptive Flow
قانون فيزيائي واحد. سبعة منتجات. 322 اختبار موثق. صفر GPU.
المبدأ الأساسي
C = sum(x) / mean(mask) # ثابت الحفاظ
Ec = |sum(x*) - C| → 0 # خطأ الحفاظ
أي إشارة فيزيائية حقيقية تحفظ مجموع طاقتها. SCAF يحوّل هذا القانون إلى خوارزمية بسيطة تعمل على 7 مجالات طبية.
التثبيت
pip install scaf-medical
مع كل الاعتماديات:
pip install scaf-medical[full]
الاستخدام السريع
SCAF-Inverse — تحسين MRI
import numpy as np
from scaf import SCAFInverse
# kspace: 2D complex array من جهاز MRI
# mask: 2D binary array (1=مقاس، 0=مفقود)
recon = SCAFInverse()
result = recon.reconstruct(kspace, mask)
# قياس الجودة
snr = recon.snr(reference, result)
print(f"SNR: {snr:.2f} dB")
SCAF-Video — إصلاح فيديو القلب
from scaf import SCAFVideo
# frames: [T, H, W] — الإطارات (المفقودة = أصفار)
# drop_mask: [T] bool — True = مفقود
fixer = SCAFVideo()
repaired = fixer.repair(frames, drop_mask)
SCAF-Guard — كشف هلوسة AI
from scaf import SCAFGuard
guard = SCAFGuard(threshold=0.05)
result = guard.verify(ai_output, reference_input)
print(result['verdict']) # PASS / WARNING / FAIL / CRITICAL
print(result['is_hallucination']) # bool
print(result['confidence']) # 0.0 - 1.0
SCAF-Cert — شهادة جودة رياضية
from scaf import SCAFCert
cert = SCAFCert()
certificate = cert.certify(reconstructed_image, mask)
print(certificate['verdict']) # CERTIFIED / WARNING / FAIL
print(certificate['bound_l2']) # الحد الأعلى لخطأ L2
print(certificate['bound_snr_db']) # الحد الأعلى لخطأ SNR
SCAF-SORL — تحسين الصور العامة
from scaf import SCAFSORL
enhancer = SCAFSORL()
enhanced = enhancer.enhance(image)
النتائج الموثقة
| المنتج | الاختبارات | النجاح | SNR Gain | الميزة |
|---|---|---|---|---|
| SCAF-Inverse | 90/90 | 100% | +1.94 dB | #1 على 4x Random |
| SCAF-Video | 120/120 | 100% | +1.47 dB | كل معدلات الفقدان |
| SCAF-Guard | 6/6 | 100% | +4.36 dB | لا مثيل له |
| SCAF-Cert | 90/90 | 100% | مضمون | بدون ground truth |
| SCAF-SORL | 3/3 | 100% | +2.16 dB | عام |
مقارنة SCAF-Inverse مع المنافسين (4x Random — M4Raw)
| الطريقة | SNR (dB) | GPU | تدريب | شهادة خطأ |
|---|---|---|---|---|
| SCAF-Inverse v2 | 15.028 | لا | لا | ✅ |
| BM3D+DC | 14.175 | لا | لا | ❌ |
| NLM+DC | 14.100 | لا | لا | ❌ |
| TV+DC | 13.692 | لا | لا | ❌ |
| Deep Learning | ~14.2 | ✅ نعم | ✅ ملايين صور | ❌ |
المعاملات المقفلة
beta = 2.42 # قوة الانتشار — ثابت عبر كل المجالات
dt = 0.05 # الخطوة الزمنية — ثابت عبر كل المجالات
kappa = 0.22 # عتبة الحواف — يتغير قليلاً بين المجالات
الاختبارات
pip install scaf-medical[dev]
pytest scaf/tests/ -v
الاقتباس
@software{scaf2025,
title = {SCAF: Structural Conservation Adaptive Flow},
author = {SCAF Research Laboratory},
year = {2025},
url = {https://github.com/scaf-lab/scaf},
note = {322 validated tests, 98.2\% success rate}
}
الترخيص
MIT License — مجاني للاستخدام البحثي والتجاري.
Metadata
Release files for scaf-lab 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| scaf_lab-1.0.0.tar.gz | 15.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scaf_lab-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.2 kB
Release files / scaf_lab-1.0.0.tar.gz
| Download URL | scaf_lab-1.0.0.tar.gz |
|---|---|
| Size | 15.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e7d01fc7a263ef57830eb5e5ebc6bc5c60e7c9e8c6e372ae6cbd884219c2789a
|
|
BLAKE2b-256 checksum How to use checksums |
bee49ee5d87e477413007f52725123493d9a02ad5309c00f62d60bad5117943e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / scaf_lab-1.0.0-py3-none-any.whl
| Download URL | scaf_lab-1.0.0-py3-none-any.whl |
|---|---|
| Size | 17.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee7a05c163541d8946d0698d7923f56bb1b2d1c0fd4024168879ca4c98147943
|
|
BLAKE2b-256 checksum How to use checksums |
0b3e1de065212791d8e48fb6628c3f25951504dedc8a3a16cb914391ac4b48b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for scaf-lab 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.