rajahshan commited on
Commit
62a7304
·
verified ·
1 Parent(s): 294b072

Initial FactoryVision AI model package (private review)

Browse files
Files changed (5) hide show
  1. README.md +53 -0
  2. SOURCE.md +8 -0
  3. labels.json +4 -0
  4. metrics.json +69 -0
  5. model.pth +3 -0
README.md ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ pipeline_tag: image-classification
5
+ library_name: pytorch
6
+ tags:
7
+ - industrial-vision
8
+ - factoryvision-ai
9
+ - casting-defect-detection
10
+ - education
11
+ ---
12
+ # FactoryVision AI — Custom CNN for Casting Inspection
13
+
14
+ **FactoryVision AI — Credits and Attribution**
15
+
16
+ **Original Developer & Model Author:** Thevanth Rajamohan
17
+ **Technical Review, Code Contributions & Model Publication Support:** Swapin Vidya
18
+ **Publishing Organisation:** TechSphere Consultancy Services Private Limited
19
+ **Hugging Face:** https://huggingface.co/TechsphereAI
20
+ **Official Website:** https://techsphereconsultancy.com/
21
+
22
+ **Project Provenance:** FactoryVision AI was originally developed by Thevanth Rajamohan. Swapin Vidya contributed technical review, detection-metrics improvements, testing, model publication preparation and documentation. The models are being prepared for publication under TechSphere Consultancy Services Private Limited's Hugging Face namespace, with the original developer's permission.
23
+
24
+ **Original GitHub Repository:** https://github.com/Theivanth/Factory-Vision-AI
25
+ **Merged contribution by Swapin Vidya:** https://github.com/Theivanth/Factory-Vision-AI/pull/1
26
+
27
+ ## Purpose and limitations
28
+ Educational two-class classification of casting images (`def_front` = defective; `ok_front` = acceptable). For **human-reviewed prototype inspection only**, not an industrial release decision or certified quality system.
29
+
30
+ ## Architecture and files
31
+ - Custom PyTorch CNN trained from scratch; see the source repository's `src/quality.py` for architecture and preprocessing
32
+ - Weights: `model.pth` (archive `checkpoints/casting_cnn.pth`)
33
+ - Exact ordered labels in `labels.json`
34
+ - Use the project's original loader and preprocessing rather than assuming a generic Hugging Face Transformer loader can use the `.pth` file.
35
+
36
+ ## Training dataset
37
+ Real-Life Industrial Dataset of Casting Product by Ravirajsinh Dabhi (https://www.kaggle.com/datasets/ravirajsinh45/real-life-industrial-dataset-of-casting-product). The source README identifies its Kaggle licence as **CC BY-NC-ND 4.0**. It includes non-commercial and no-derivatives restrictions. The rights to publish dataset-trained checkpoint weights require separate verification; model-developer consent does not settle third-party licensing. No input images are redistributed here.
38
+
39
+ ## Held-out test performance (from supplied Kaggle output)
40
+ - Accuracy: **0.9860**
41
+ - Macro precision: **0.9849**
42
+ - Macro recall: **0.9849**
43
+ - Macro F1: **0.9849**
44
+ - Test confusion matrix (rows true, columns predicted; class order `def_front`, `ok_front`): `[[448, 5], [5, 257]]`
45
+ - Mean inference latency reported by Kaggle: **0.608 ms** (environment/measurement specific; not a target CPU benchmark)
46
+
47
+ The metrics are reported, not independently reproduced. The model is not validated on new factory deployments.
48
+
49
+ ## Inference and dependencies
50
+ The checkpoint is intended to be loaded using the matching architecture from `src/quality.py` in https://github.com/Theivanth/Factory-Vision-AI . Do **not** call arbitrary `torch.load` on untrusted checkpoints. The project has known image-size, normalisation, and class-order requirements; check the current source for exact implementation before inference.
51
+
52
+ ## Licensing and distribution
53
+ The source project has an MIT licence for **its code**, not necessarily the checkpoint. **Keep this repository private until the casting dataset's non-commercial/no-derivatives conditions and trained-weight publication rights have been resolved.** No model-weight licence is asserted in this card.
SOURCE.md ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ Source: https://github.com/Theivanth/Factory-Vision-AI
2
+ Original Project Developer and Model Author: Thevanth Rajamohan
3
+ Technical Reviewer, Code Contributor and Hugging Face Publication Support: Swapin Vidya
4
+ Publishing Organisation: TechSphere Consultancy Services Private Limited
5
+ Hugging Face: https://huggingface.co/TechsphereAI
6
+ Official Website: https://techsphereconsultancy.com/
7
+ Swapin Vidya's merged contribution: https://github.com/Theivanth/Factory-Vision-AI/pull/1
8
+ Model checkpoint SHA-256: 572501b104e64582206938e8f4038735ab082b8d4e2fe473b47ffa15aeffc427
labels.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ [
2
+ "def_front",
3
+ "ok_front"
4
+ ]
metrics.json ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "checkpoint": "casting_cnn.pth",
3
+ "validation": {
4
+ "accuracy": 0.9954337899543378,
5
+ "precision_macro": 0.9953362800030287,
6
+ "recall_macro": 0.9953362800030287,
7
+ "macro_f1": 0.9953362800030287,
8
+ "per_class_precision": {
9
+ "def_front": 0.9960106382978723,
10
+ "ok_front": 0.994661921708185
11
+ },
12
+ "per_class_recall": {
13
+ "def_front": 0.9960106382978723,
14
+ "ok_front": 0.994661921708185
15
+ },
16
+ "per_class_f1": {
17
+ "def_front": 0.9960106382978723,
18
+ "ok_front": 0.994661921708185
19
+ },
20
+ "confusion_matrix": [
21
+ [
22
+ 749,
23
+ 3
24
+ ],
25
+ [
26
+ 3,
27
+ 559
28
+ ]
29
+ ],
30
+ "classes": [
31
+ "def_front",
32
+ "ok_front"
33
+ ],
34
+ "mean_inference_latency_ms": 0.6061720205487975
35
+ },
36
+ "test": {
37
+ "accuracy": 0.986013986013986,
38
+ "precision_macro": 0.9849392514702662,
39
+ "recall_macro": 0.9849392514702662,
40
+ "macro_f1": 0.9849392514702662,
41
+ "per_class_precision": {
42
+ "def_front": 0.9889624724061811,
43
+ "ok_front": 0.9809160305343512
44
+ },
45
+ "per_class_recall": {
46
+ "def_front": 0.9889624724061811,
47
+ "ok_front": 0.9809160305343512
48
+ },
49
+ "per_class_f1": {
50
+ "def_front": 0.9889624724061811,
51
+ "ok_front": 0.9809160305343512
52
+ },
53
+ "confusion_matrix": [
54
+ [
55
+ 448,
56
+ 5
57
+ ],
58
+ [
59
+ 5,
60
+ 257
61
+ ]
62
+ ],
63
+ "classes": [
64
+ "def_front",
65
+ "ok_front"
66
+ ],
67
+ "mean_inference_latency_ms": 0.6078423272728369
68
+ }
69
+ }
model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:572501b104e64582206938e8f4038735ab082b8d4e2fe473b47ffa15aeffc427
3
+ size 385362