Photovoltaic (PV) defect segmentation often misses small cracks because the cracks occupy only a few pixels, have low contrast against the cell texture, and are easily confused with grain boundaries or busbar reflections. The fix combines higher-resolution imaging, data augmentation that simulates thin cracks, and a loss function that penalizes missing tiny objects. This article explains the root causes and gives practical solutions for engineers and researchers working on automated solar panel inspection.
Formula
The core formula for pace and speed is simple: pace (min/km) = time (min) / distance (km) and speed (km/h) = distance (km) / (time (min) / 60). Here, t is the total finish time in minutes, d is the distance in kilometers, pace is the average time per kilometer, and speed is the average velocity in kilometers per hour. The calculator uses these two equations directly, with the first output (pace) shown as the headline result.
Worked Example
Suppose you run 10 km in 50 minutes. First, compute pace: 50 min / 10 km = 5.0 min/km. Next, compute speed: 10 km / (50 / 60) = 10 / 0.8333 = 12.0 km/h. The calculator returns pace = 5.00 min/km and speed = 12.00 km/h, matching the default inputs exactly.
Why Small Cracks Are Missed
Small cracks in solar cells are typically 10–100 micrometers wide, but in a standard electroluminescence (EL) image at 0.1–0.5 mm/pixel, they span only 1–3 pixels. Segmentation models, especially U-Net or DeepLab variants, downsample the image multiple times, and each pooling or stride step reduces the spatial resolution. A 2-pixel crack can vanish entirely after two downsampling operations. Additionally, the loss function (e.g., binary cross-entropy) is dominated by the vast number of background pixels—often over 99%—so the model learns to predict background and still achieves high accuracy. Small cracks contribute so little to the loss that the gradient signal is negligible, and the model never learns to detect them.
How Segmentation Models Work
Typical PV defect segmentation uses a convolutional neural network (CNN) encoder-decoder. The encoder extracts features at multiple scales, and the decoder upsamples to produce a pixel-wise mask. The problem is that the encoder’s deepest layers have the lowest resolution—often 1/32 of the input—so a thin crack is reduced to a single point or disappears. Attention mechanisms and skip connections help but do not fully solve the issue. Transformer-based models (e.g., SegFormer) use global attention but still rely on patch embeddings that can blur fine details. The result is that small cracks are either merged into the background or predicted as a single blob that misses the crack’s true extent.
How to Fix It: Practical Steps
Fixing small-crack segmentation requires changes at multiple levels: data, model, and loss.
- Increase input resolution – Use images at 1024×1024 or higher instead of 512×512. This gives more pixels per crack, but increases memory and training time.
- Use a loss function that focuses on hard pixels – Focal loss or Tversky loss down-weights easy background pixels and up-weights rare foreground pixels. Dice loss alone is better than cross-entropy but can still be unstable for tiny objects.
- Add synthetic cracks to training data – Generate thin lines with random orientation, width, and brightness, and paste them onto defect-free cells. This forces the model to learn crack-specific features.
- Use a two-stage approach – First run a detection model (e.g., YOLO) to find regions of interest, then run segmentation only on those crops. This avoids the resolution loss from global downsampling.
- Apply post-processing with morphological operations – Thin cracks can be connected using dilation and skeletonization, but this may introduce false positives.
- Train with a higher weight for crack pixels – Use a weighted cross-entropy where foreground weight is set to 10–50× the background weight.
Common Problems and Misconceptions
A common misconception is that adding more training images of cracks will automatically fix the problem. In reality, if the cracks are still tiny and the loss is dominated by background, the model will ignore them. Another issue is that EL images vary in brightness due to current injection and camera settings; a model trained on one dataset may fail on another. Also, many public PV defect datasets (e.g., ELPV) have images with large cracks, but small cracks are underrepresented. Finally, some engineers assume that a high pixel accuracy (e.g., 99%) means the model is good—but if cracks are 0.1% of pixels, a model that predicts all background achieves 99.9% accuracy while missing every crack. Always use IoU (Intersection over Union) on the crack class as the metric.
Comparing Solutions: What Works Best
In practice, a combination of high-resolution input (1024×1024) and a Tversky or focal loss gives the biggest improvement for small cracks. A U-Net with a ResNet-34 encoder and a feature pyramid network (FPN) head performs well. Transformer models can capture global context but are slower and require more data. The two-stage detection-then-segmentation approach is effective for very small cracks but adds complexity. Data augmentation (random rotation, scaling, adding noise) helps generalization but does not directly solve the small-object problem. For real-time inspection on a production line, a lightweight model with 512×512 input and a custom loss may be the only viable option, but it will miss very small cracks—so a trade-off between speed and sensitivity is unavoidable.
Costs and Practical Considerations
Improving small-crack detection increases computational cost. A 1024×1024 input roughly quadruples the FLOPs compared to 512×512, which may slow inference from 10 ms to 40 ms per image on a GPU. Training time also increases. If you use a two-stage approach, you need an additional detection model, which adds development time. However, the cost of missing a crack in a solar module can be high—a microcrack can grow under thermal cycling and lead to power loss or hot spots. The choice depends on your application: for offline lab analysis, use the best possible model; for inline inspection, you may need to accept a lower recall and use a separate high-resolution scan only for suspicious regions.
Safety and Accuracy Notes
When working with EL imaging, always follow the camera and laser safety guidelines—EL imaging typically uses a forward bias current (up to 10 A) and may require darkroom conditions. Never look directly at a laser if used for illumination. For the calculator, the formulas assume a constant pace; if you run with varying speed, the average pace is still valid, but the instantaneous pace varies. The calculator is for general use and does not account for elevation, rest stops, or GPS inaccuracies. Always verify your results with a reliable timing device.
Frequently Asked Questions
Why does my model get 99% accuracy but miss all cracks?
Because cracks occupy a tiny fraction of pixels, a model that predicts all background achieves high accuracy. Use Dice loss or IoU as the metric, and inspect the confusion matrix for the crack class.
What is the best loss function for small cracks?
Focal loss and Tversky loss are designed to handle class imbalance. For extremely small cracks, a combination of Dice and focal loss often works well. Avoid plain binary cross-entropy.
Do I need higher resolution images?
Yes, if the crack width is less than 3 pixels in the current image, increasing resolution helps. But higher resolution increases memory and training time, so balance it with your hardware.
Can I use data augmentation to fix the problem?
Data augmentation helps generalization but does not solve the fundamental issue of tiny objects. You still need a loss function that emphasizes rare pixels and enough training examples of small cracks.
Is a U-Net enough for small crack segmentation?
U-Net works, but you need to modify it: use a deeper encoder, add a feature pyramid, and use a loss that focuses on small objects. A plain U-Net with cross-entropy will likely fail.
How many training images do I need?
There is no fixed number, but for deep learning, you typically need at least a few hundred images with cracks. If you have fewer, use synthetic cracks or transfer learning from a pretrained model.
Related
Formula used
in t | Finish time | min | 50 | 0 in d | Distance | km | 10 | 0 | 100000 out pace | Average pace | min/km | t / d | 2 out speed | Average speed | km/h | d / (t / 60) | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Blockchain vs Database: When Does Distributed Trust Win?
- GTA 6 and Call of Duty on Same Console?
- MCP in Production: Security Failures Behind the Backdoor Label
- Nothing Phone 2 Waterproof? IP54 Rating Explained
- Satellite Internet Equipment & Installation Guide
- Infinix GT 20 Pro vs AI Nova 2 Ultra 5G: Which Fits?