CNN-T

Hybrid Architecture Based on CNN and Transformer for Strip Steel Surface Defect Classification based on this publication. This can be used for piping, equipment, structural steel surface defect analysis.

This dataset and calculations are for educational purposes only  solely based on author's analysis.


model

We will define a PyTorch model that includes the convolution module, patch embedding, transformer encoder with specified layers, and an MLP classifier. This implementation including convolutional layers with specific kernel sizes and numbers, the transformer encoder structure, and the MLP classifier components.

Convolution Module

This module will consist of four standard convolutional layers, each followed by batch normalization and ReLU activation. Processes the input image through four convolutional layers, each followed by batch normalization and ReLU activation. This module is designed to extract hierarchical features from the input image.

Patch Embedding

This step involves a convolutional layer that adjusts the feature map's depth, followed by reshaping for the transformer encoder. Converts the feature maps from the convolution module into a sequence of embeddings. A 1x1 convolution is applied to adjust the depth of the feature map to the desired size for patch embedding. The feature map is then flattened and transposed to match the input format expected by the Transformer encoder.

Transformer Encoder

We'll define a simplified transformer layer based on our descriptive model. Since the detailed implementation of a full transformer encoder is extensive, this will provide a basic structure  comprises of two simplified Transformer encoder layers. Each layer includes a multi-head self-attention mechanism and a feedforward neural network, both wrapped in residual connections and followed by layer normalization. The forward pass of the encoder processes the sequence of patch embeddings to capture complex dependencies among them.

The Transformer encoder layer as outlined here is a simplified version focusing on key components like multi-head self-attention and feedforward neural networks. A more complex or complete implementation might include additional details such as separate forward layers for each sub-layer, more sophisticated attention mechanisms, or different normalization strategies.

MLP Classifier

This classifier will use the specified fully connected layers, dropout, and GELU activation. The mean of the output embeddings from the Transformer encoder is used (assuming no explicit class token is introduced in this simplified version). The resulting vector is then passed through a fully connected layer (with GELU activation and dropout) to produce the final class predictions.

crack growth analysis

Cyclic stress loading can initiate and propagate cracks within a material, eventually leading to fracture at stresses significantly lower than the yield or ultimate strength. 

As an example below, for Sulfur Recovery Unit, the #50 are subjected to Boiler WAter / Condensate Corrosion and #38 for Flue Gas Dew Point Corrosion. The boiler feedwater(BFW) is feed in the steam drum to heat the water at certain temperature to maintain the viscosity of the sulphur using jacketed pipe.

sAMPLE OF STRESS CORROSION CIRCUIT

UT(Ultrasonic) and RT (Radiograph) Test.

stress corrosion cracking