## Textile Image Dataset

This package provides the simulated textile images used in\
**[Megahed et al., 2025](https://arxiv.org/pdf/2501.12596)** for
few-shot CLIP classification experiments.

These images were originally generated using the R script below and were
previously released under an MIT License in our repository:

-   Image generation script:\
    https://raw.githubusercontent.com/fmegahed/qe_genai/refs/heads/main/data/textile_images/extract_textile_images_from_r\_textile_pkg.R

-   Original dataset release:\
    https://github.com/fmegahed/qe_genai/tree/main/data/textile_images

### Dataset Summary

To systematically evaluate CLIP's performance on STS image
classification, we used the **spc4sts** R package to create a controlled
dataset of simulated textile fabric textures. This approach allowed us
to precisely model both nominal and defective weave structures and to
control defect type and severity.

Our dataset contains:

  Class            Description                             Count
  ---------------- --------------------------------------- -----------
  Nominal          Standard textile weave patterns         **1,000**
  Local defects    Localized disruptions in the weave      **500**
  Global defects   Systematic shifts in weave parameters   **500**

Each image is **250 × 250 px**, generated using `spc4sts` recommended
parameters:

-   **Nominal images:**\
    Spatial autoregressive parameters ϕ₁ = 0.6, ϕ₂ = 0.35

-   **Global defects:**\
    Both parameters reduced by **5%**

-   **Local defects:**\
    Generated using the package's defect-insertion functions

### Citation

If you use this dataset, please cite:

> **Megahed et al., 2025**  
> *Adapting OpenAI's CLIP Model for Few-Shot Image Inspection in Manufacturing Quality Control: An Expository Case Study with Multiple Application Examples*  
> [arXiv:2501.12596](https://arxiv.org/pdf/2501.12596)


> **Bui, A. T., & Apley, D. W. (2020)*. 
>*spc4sts: Statistical process control for stochastic textured surfaces in R. 
> [Journal of Quality Technology, 53(3), 219–242](https://doi.org/10.1080/00224065.2019.1707730).

### License

These images were generated by the authors and are released under the MIT License.
