File size: 4,945 Bytes
bbb083f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# πŸ”¬ CompositeDefect AI - NDT Analysis System

A comprehensive machine learning-based web application for detecting and analyzing defects in composite materials using various Non-Destructive Testing (NDT) methods.

## 🎯 Features

### Supported NDT Methods
- **Visual Testing (VT)** - Surface defect detection
- **Ultrasonic Testing (UT)** - Internal defect detection using sound waves
- **Magnetic Particle Testing (MPT)** - Surface and near-surface defects
- **Radiographic Testing (RT)** - X-ray based internal inspection
- **Liquid Penetrant Testing (LPT)** - Surface-breaking defects
- **Eddy Current Testing (ECT)** - Conductive material inspection
- **Thermal/Infrared Testing (IRT)** - Heat-based defect detection
- **Microwave NDT** - Dielectric material inspection
- **Vibration Analysis** - Structural integrity assessment

### Composite Materials Supported
- Carbon Fibre Reinforced Polymer (CFRP)
- Glass Fibre Reinforced Polymer (GFRP)
- Aramid Fibre Reinforced Polymer (AFRP)
- Hybrid Composites

### Detectable Defect Types
- **Delamination** - Layer separation in composites
- **Cracks** - Structural fractures
- **Voids** - Air pockets and porosity
- **Fibre Misalignment** - Incorrect fibre orientation
- **Resin Rich Areas** - Excess resin concentration
- **Resin Starved Areas** - Insufficient resin coverage

## πŸš€ Getting Started

### Prerequisites
- Python 3.8 or higher
- pip package manager

### Installation

1. Clone or download the project:
```bash
cd composite-defect-detector
```

2. Install required dependencies:
```bash
pip install -r requirements.txt
```

3. Run the Streamlit application:
```bash
streamlit run app.py
```

4. Open your browser and navigate to:
```
http://localhost:8501
```

## πŸ“– Usage Guide

### 1. Configure Analysis Parameters
- Select the **NDT Method** used for inspection
- Choose the **Material Type** being analyzed
- Adjust **Detection Sensitivity** (0.1 - 1.0)
- Set **Confidence Threshold** (0.5 - 0.95)
- Select which **Defect Types** to detect

### 2. Upload NDT Images
- Click "Browse files" to upload your NDT inspection images
- Supported formats: JPG, JPEG, PNG, TIFF, BMP
- Preview the uploaded image before analysis

### 3. Run AI Analysis
- Click "Start AI Analysis" button
- The system will preprocess the image based on NDT method
- ML model will detect and classify defects
- Results will be displayed in real-time

### 4. Review Results
- **Detection Results Tab**: View detected defects with bounding boxes
- **Detailed Analysis Tab**: See charts, statistics, and recommendations
- **History Tab**: Access previous analyses

### 5. Export Reports
- Download annotated images (PNG)
- Export defect data (CSV)
- Generate comprehensive JSON reports

## 🎨 Color Scheme

The application uses a modern dark theme with:
- **Primary Background**: Black (#0a0a0a)
- **Secondary Background**: Dark Grey (#141414, #1e1e1e)
- **Text**: White (#ffffff) and Light Grey (#b0b0b0)
- **Accent Colors**: 
  - Blue (#3b82f6) - Primary actions
  - Purple (#8b5cf6) - Secondary accents
  - Cyan (#06b6d4) - Highlights

## πŸ”§ Technical Details

### ML Model Architecture
- Image preprocessing based on NDT method type
- Simulated deep learning defect detection
- Multi-class classification for defect types
- Confidence scoring and severity assessment

### Key Libraries
- **Streamlit** - Web application framework
- **OpenCV** - Image processing
- **Pillow** - Image manipulation
- **NumPy** - Numerical computations
- **Plotly** - Interactive visualizations
- **scikit-learn** - Machine learning utilities
- **TensorFlow/Keras** - Deep learning framework

## πŸ“Š Analysis Outputs

### Metrics Provided
- Total defect count
- Defect type distribution
- Severity classification (Low/Medium/High/Critical)
- Confidence scores
- Defect area measurements (mmΒ²)
- Position coordinates

### Visualizations
- Pie chart: Defect type distribution
- Bar chart: Severity distribution
- Histogram: Confidence score distribution
- Annotated images with bounding boxes

### Reports
- Test information summary
- Defect recommendations
- Exportable CSV, JSON, and image formats

## ⚠️ Severity Levels

- **Critical** (Red) - Immediate action required
- **High** (Orange) - Attention required, schedule maintenance
- **Medium** (Yellow) - Monitor and plan repair
- **Low** (Green) - Acceptable, continue monitoring

## πŸ”’ Safety Notes

This tool is designed to assist NDT professionals and engineers. Always:
- Verify AI results with manual inspection
- Follow industry standards for defect acceptance
- Consult certified NDT professionals for critical decisions
- Use as a supplementary tool, not a replacement for expert judgment

## πŸ“ License

This project is for educational and research purposes.

## 🀝 Contributing

Contributions are welcome! Please feel free to submit issues and enhancement requests.

---

**Developed with ❀️ for the NDT and Composites Community**