GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Taxueovo/Prepreg-Fiber-Orientation: Sanitized research code for surface fiber-orientation regression of carbon-fiber prepreg (ConvNeXt-Tiny backbone with optional DINOv3 initialization)

BranchesTags
Open more actions menu

Latest commit

 

History

14 Commits
14 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
dataset
dataset
 
 
docs
docs
 
 
tests
tests
 
 
thesis_experiment_packages
thesis_experiment_packages
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
fiber_orientation.py
fiber_orientation.py
 
 
gst_baseline.py
gst_baseline.py
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

Prepreg Fiber Orientation Estimation

Prepreg Fiber Orientation Estimation

CI License: MIT Python PyTorch

Research code for estimating the acute surface-fiber orientation angle of carbon-fiber prepreg from microscopy patches. The model uses a ConvNeXt-Tiny spatial backbone, optionally initialized from DINOv3 self-supervised weights, and combines orientation-aware attention, an annular FFT frequency branch, and heteroscedastic uncertainty estimation.

Sanitized code release. The full raw dataset, label manifests, model weights, experiment outputs, manuscripts, author information, and machine-specific paths are intentionally excluded. A few de-identified sample patches are included under dataset/samples/ for illustration; see dataset/README.md. The repository does not claim benchmark results that cannot be independently verified from the published artifacts.

Table of Contents

  • Highlights
  • Method Overview
  • Repository Layout
  • Quick Start
  • Installation
  • Dataset Layout
  • Training
  • GST Baseline
  • Reproducibility Experiments
  • Validation
  • License

Highlights

  • Parent-image-disjoint train, validation, and test interfaces.
  • ConvNeXt-Tiny backbone with optional orientation-aware spatial attention.
  • Optional annular FFT feature branch.
  • Acute-angle regression with optional heteroscedastic loss.
  • Validation-based early stopping, per-epoch metrics, checkpointing, and path-safe prediction exports.
  • A Gradient Structure Tensor (GST) classical computer-vision baseline.
  • Eight reproducibility protocols (E01–E08): initialization controls, factorial ablation, external-domain evaluation, uncertainty calibration, metrology validation, label efficiency, rotation equivariance, and latency analysis.

Method Overview

A ConvNeXt-Tiny backbone extracts spatial features from microscopy patches. An optional Gabor orientation attention module (inserted after backbone stage 2) learns an orientation-relevant attention map, while an optional annular FFT branch pools frequency content in a ring band around the spectrum center. The two streams are fused and fed to an angle regression head; an optional heteroscedastic head predicts per-sample log-variance to quantify uncertainty.

flowchart LR
    P["Patch<br/>(H×W×3)"] --> B["ConvNeXt-Tiny<br/>backbone"]
    B --> G["Gabor orientation<br/>attention"]
    G --> PF["Adaptive<br/>avg-pool"]
    P --> F["Annular FFT<br/>branch"]
    F --> C["Fuse"]
    PF --> C
    C --> MLP["Fusion MLP"]
    MLP --> A["Angle head<br/>θ ∈ [0°, 90°]"]
    MLP --> U["Log-var head<br/>σ (uncertainty)"]
Loading

The target angle is folded into the acute range [0°, 90°] before regression; the predicted angle is recovered as θ = 90° · sigmoid(head).

Repository Layout

.
├── dataset/                     # De-identified sample patches + dataset README
├── fiber_orientation.py         # Training / regression entry point
├── gst_baseline.py              # Gradient Structure Tensor baseline
├── thesis_experiment_packages/  # E01–E08 reproducibility protocols
├── tests/                       # Release checks (no deep-learning deps)
├── docs/banner.svg              # Repository banner
├── .github/workflows/ci.yml     # CI pipeline
├── requirements.txt
└── LICENSE

Quick Start

git clone https://github.com/Taxueovo/prepreg-fiber-orientation.git
cd prepreg-fiber-orientation

python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

python fiber_orientation.py --data-dir /path/to/database --device cuda:0

Installation

Python 3.10 or 3.11 is recommended. Install the PyTorch build appropriate for your CUDA, ROCm, or CPU environment, then install the remaining dependencies:

python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

Dataset Layout

The full dataset is user-supplied and must not be committed to Git; only a small set of de-identified sample patches is included. The default layout is:

database/
├── train/
│   ├── train.csv
│   └── images/
├── val/
│   ├── val.csv
│   └── images/
└── test/
    ├── test.csv
    └── images/

Each CSV must contain at least:

patch_filename,source_image,angle,x,y
sample_0001.jpg,source_001.jpg,45.0,0,0

patch_filename must be a safe path relative to the corresponding images/ directory. angle is folded into the acute range [0°, 90°]. The source_image, x, and y fields support parent-image traceability; the training loader directly consumes patch_filename and angle.

Sample patches

Six de-identified 512×512 sample patches spanning the orientation-angle range (≈41°–88°) are provided under dataset/samples/ so the data appearance and format are visible without downloading the full set. See dataset/README.md for the manifest format and full-dataset statistics.

Training

python fiber_orientation.py \
  --data-dir /path/to/database \
  --weights /path/to/dinov3_convnext_tiny.pth \
  --require-pretrained \
  --device cuda:0 \
  --epochs 150 \
  --batch-size 64

If --weights is omitted, the backbone uses random initialization. For controlled pretraining experiments, also pass --require-pretrained so a missing checkpoint fails explicitly. --device auto selects CUDA when available and otherwise uses CPU; cpu, cuda:0, and mps can also be selected explicitly.

Common paths may be configured with environment variables:

export FIBER_ORIENTATION_DATA_DIR=/path/to/database
export FIBER_ORIENTATION_WEIGHTS=/path/to/checkpoint.pth
export FIBER_ORIENTATION_RUNS_DIR=/path/to/runs
export FIBER_ORIENTATION_DEVICE=cuda:0

Training artifacts are written to runs/ by default and are ignored by Git. Configuration snapshots and prediction exports remove workstation-specific absolute paths.

GST Baseline

python gst_baseline.py \
  --csv /path/to/test.csv \
  --image_root /path/to/test/images \
  --output /path/to/gst_predictions.csv

Reproducibility Experiments

See thesis_experiment_packages/README.md for the eight experiment protocols. Training scripts read from FIBER_ORIENTATION_DATA_DIR or the project-local database/ directory. Generated outputs are written under the ignored thesis_experiment_packages/results/ directory.

Validation

The release checks do not require deep-learning dependencies:

PYTHONPYCACHEPREFIX=/tmp/fiber-orientation-pycache python -m compileall -q \
  fiber_orientation.py gst_baseline.py thesis_experiment_packages tests
python -m unittest discover -s tests -v

Full training requires legally obtained data and a compatible checkpoint. Follow the licenses and usage terms of the dataset, pretrained model, and third-party dependencies.

License

Distributed under the MIT License. Data, labels, and pretrained checkpoints are not covered by this license.

About

Sanitized research code for surface fiber-orientation regression of carbon-fiber prepreg (ConvNeXt-Tiny backbone with optional DINOv3 initialization)

Topics

carbon-fibercomputer-visionconvnextdeep-learningfiber-orientationprepregpytorchregressionresearchuncertainty-estimation

Resources

Readme
MIT license

Security policy

Security policy
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.