Photovoltaic_Fault_Detector

Model Photovoltaic Fault Detector based in model detector YOLOv.3, this repository contains four detector model with their weights and the explanation of how to use these models.

https://github.com/RentadroneCL/Photovoltaic_Fault_Detector

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.4%) to scientific vocabulary

Keywords

deep-learning detection-boxes detector-model fault-detection keras model-detection object-detection photovoltaic-panels solar-energy tensorflow yolo3
Last synced: 6 months ago · JSON representation

Repository

Model Photovoltaic Fault Detector based in model detector YOLOv.3, this repository contains four detector model with their weights and the explanation of how to use these models.

Basic Info
  • Host: GitHub
  • Owner: RentadroneCL
  • License: gpl-3.0
  • Language: Jupyter Notebook
  • Default Branch: master
  • Homepage: https://simplemap.io
  • Size: 102 MB
Statistics
  • Stars: 46
  • Watchers: 6
  • Forks: 18
  • Open Issues: 6
  • Releases: 0
Topics
deep-learning detection-boxes detector-model fault-detection keras model-detection object-detection photovoltaic-panels solar-energy tensorflow yolo3
Created about 6 years ago · Last pushed almost 3 years ago
Metadata Files
Readme Contributing License Code of conduct

README.md

Photovoltaic Fault Detector

GitHub Contributor Covenant Open Source Helpers Coverage Status

SimpleMap.io

Forum

This project is part of the UNICEF Innovation Fund Discourse community. You can post comments or questions about each category of SimpleMap.io Open-Source Initiative algorithms. We encourage users to participate in the forum and to engage with fellow users.

Summary

Model-definition is a deep learning application for fault detection in photovoltaic plants. In this repository you will find trained detection models that point out where the panel faults are by using radiometric thermal infrared pictures. In Web-API contains a performant, production-ready reference implementation of this repository.

Data Flow

To do list:

  • [x] Import model detection (SSD & YOLO3)
  • [x] Example use Trained Model
  • [x] Train and Evaluate Model with own data
  • [x] Model Panel Detection (SSD7)
  • [x] Model Panel Detection (YOLO3)
  • [x] Model Soiling Fault Detection (YOLO3)
  • [x] Model Diode Fault Detection (YOLO3)
  • [x] Model Other Fault Detection
  • [x] Model Fault Panel Disconnect

Requirements

  • Python 3.x
  • Numpy
  • TensorFlow 2.x
  • Keras 2.x (in TensorFlow)
  • OpenCV
  • Beautiful Soup 4.x

Quickstart

In the root project execute the following command to install all dependencies project

``` pip install -r requirements.txt

``` You need install Jupyter notebook to see the code example. You can find the installation documentation for the Jupyter platform, on ReadTheDocs or in github page here.

For a local installation, make sure you have pip installed and run: ``` pip install notebook

```

Example to use trained model

In 'Example_Prediction' this is the example of how to implement an already trained model, it can be modified to change the model you have to use and the image in which you want to detect faults.

In 'Example Prediction AllInOne' this is the example of how implement all trained model, you can use this code for predict a folder of images and have a output image with detection boxes.

In 'ExamplePredictionOrthophoto' this is the example of how implement all trained model, you can use this code for predict a Orthophot and have a output image with detection boxes.

Developers

Help improve our software! We welcome contributions from everyone, whether to add new features, improve speed, fix existing bugs or add support. Check our code of conduct, the contributing guidelines and how decisions are made.

Any code contributions are welcomed as long as they are discussed in Github Issues with maintainers. Be aware that if you decide to change something and submit a PR on your own, it may not be accepted.

Creating an issue

You can open a new issue based on code from an existing pull request. For more information, see the template for filling issues

Model Detection

The models used for detection are SSD SSD: Single Shot MultiBox Detector and YOLOv3 YOLOv3: An Incremental Improvement, they are imported from the following repositories: * SSD_Keras * YOLOv3_Keras

Grab the pretrained weights of SSD and YOLO3 from Drive_Weights

| Model | Pretrained Weights | |:-----------:|:-------------------:| | SSD7/SSD300 | Weight VGG16| | YOLO3 | Weight Full Yolo3|

Type of Data

The images used for the design of this model were extracted by air analysis, specifically: FLIR aerial radiometric thermal infrared pictures, taken by UAV (R-JPEG format). Which were converted into .jpg images for the training of these detection models. Example FLIR image:

FLIR

Same image in .jpg format:

JPG

Training

1. Data preparation

View folder Train&TestA/ and Train&TestS/, example of panel anns and soiling fault anns.

Organize the dataset into 4 folders:

  • trainimagefolder <= the folder that contains the train images.

  • trainannotfolder <= the folder that contains the train annotations in VOC format.

  • validimagefolder <= the folder that contains the validation images.

  • validannotfolder <= the folder that contains the validation annotations in VOC format.

There is a one-to-one correspondence by file name between images and annotations. For create own data set use LabelImg code from : https://github.com/tzutalin/labelImg

2. Edit the configuration file

The configuration file for YOLO3 is a json file, which looks like this (example soiling fault ):

```python { "model" : { "mininputsize": 400, "maxinputsize": 400, "anchors": [5,7, 10,14, 15, 15, 26,32, 45,119, 54,18, 94,59, 109,183, 200,21], "labels": ["1"], "backend": "fullyolobackend.h5" },

"train": {
    "train_image_folder":   "../Train&Test_S/Train/images/",
    "train_annot_folder":   "../Train&Test_S/Train/anns/",
"cache_name":           "../Experimento_fault_1/Resultados_yolo3/full_yolo/experimento_fault_1_gpu.pkl",

    "train_times":          1,

    "batch_size":           2,
    "learning_rate":        1e-4,
    "nb_epochs":            200,
    "warmup_epochs":        15,
    "ignore_thresh":        0.5,
    "gpus":                 "0,1",

"grid_scales":          [1,1,1],
    "obj_scale":            5,
    "noobj_scale":          1,
    "xywh_scale":           1,
    "class_scale":          1,

"tensorboard_dir":      "log_experimento_fault_gpu",
"saved_weights_name":   "../Experimento_fault_1/Resultados_yolo3/full_yolo/experimento_yolo3_full_fault.h5",
    "debug":                true
},

"valid": {
    "valid_image_folder":   "../Train&Test_S/Test/images/",
    "valid_annot_folder":   "../Train&Test_S/Test/anns/",
    "cache_name":           "../Experimento_fault_1/Resultados_yolo3/full_yolo/val_fault_1.pkl",

    "valid_times":          1
},

"test": { "testimagefolder": "../Train&TestS/Test/images/", "testannotfolder": "../Train&TestS/Test/anns/", "cachename": "../Experimentofault1/Resultadosyolo3/fullyolo/testfault_1.pkl",

    "test_times":          1
}

} The configuration file for SSD300 is a json file, which looks like this (example soiling fault ) and .txt with name of images (train.txt): { "model" : { "backend": "ssd300", "input": 400, "labels": ["1"] },

"train": {
    "train_image_folder":   "Train&Test_S/Train/images",
    "train_annot_folder":   "Train&Test_S/Train/anns",
    "train_image_set_filename": "Train&Test_S/Train/train.txt",

    "train_times":          1,
    "batch_size":           12,
    "learning_rate":        1e-4,
    "warmup_epochs":        3,
    "nb_epochs":            100,
       "saved_weights_name":     "Result_ssd300_fault_1/experimento_ssd300_fault_1.h5",
    "debug":                true
},
"valid": {
        "valid_image_folder":   "../Train&Test_D/Test/images/",
        "valid_annot_folder":   "../Train&Test_D/Test/anns/",
        "valid_image_set_filename":   "../Train&Test_D/Test/test.txt"
    },

"test": { "testimagefolder": "Train&TestS/Test/images", "testannotfolder": "Train&TestS/Test/anns", "testimagesetfilename": "Train&TestS/Test/test.txt" } } ```

3. Start the training process

python train_ssd.py -c config.json -o /path/to/result

or python train_yolo.py -c config.json -o /path/to/result

By the end of this process, the code will write the weights of the best model to file bestweights.h5 (or whatever name specified in the setting "savedweights_name" in the config.json file). The training process stops when the loss on the validation set is not improved in 20 consecutive epoches.

4. Perform detection using trained weights on image, set of images

python predict_ssd.py -c config.json -i /path/to/image/or/video -o /path/output/result or python predict_yolo.py -c config.json -i /path/to/image/or/video -o /path/output/result

It carries out detection on the image and write the image with detected bounding boxes to the same folder.

Evaluation

The evaluation is integrated into the training process, if you want to do the independent evaluation you must go to the folder ssd_keras-master or keras-yolo3-master and use the following code

python evaluate.py -c config.json Example: python keras-yolo3-master/evaluate.py -c config_full_yolo_fault_1_infer.json

Compute the mAP performance of the model defined in saved_weights_name on the validation dataset defined in valid_image_folder and valid_annot_folder.

| Model | mAP | Config | |:--------------: |:------------------:|:------------------:| | YOLO3 Soiling | 0.7302 |config | | YOLO3 Diode | 0.6127 | config| | YOLO3 Affected Cell | 0.7230 | config|

Weights of Trained Models

All of weights of this trained model grab from Drive_Weights

| Model | Weights Trained | Config | |:--------------:|:------------------:|:--------:| | SSD7 Panel | weight | config | | SSD300 Soiling | weight | config | | YOLO3 Panel | weight | config | | YOLO3 Soiling | weight | config | | YOLO3 Diode | weight | config | | YOLO3 Affected Cell | weight | config |

The image used are specified in Table images. You can see some examples in Summary of results.

Contributing

Contributions are welcome and will be fully credited. We accept contributions via Pull Requests on GitHub.

Pull Request Checklist

Before sending your pull requests, make sure you followed this list.

Owner

  • Name: simplemap.io (former Rentadrone.cl)
  • Login: RentadroneCL
  • Kind: organization
  • Email: contacto@simplemap.io
  • Location: Santiago, Chile

Mapping Processing and Asset Management for Renewable Enegies and Agriculture sectors

GitHub Events

Total
  • Watch event: 8
Last Year
  • Watch event: 8

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 120
  • Total Committers: 7
  • Avg Commits per committer: 17.143
  • Development Distribution Score (DDS): 0.225
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Daniel Saavedra d****a@u****l 93
Hector Bastidas 6****e 9
Alvaro Farias a****s@p****m 8
Alvaro Farias a****n@g****m 3
Hector Bastidas 6****G 3
jrejon 3****n 3
Alvaro Farias p****y@g****m 1
Committer Domains (Top 20 + Academic)
uc.cl: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 9
  • Total pull requests: 29
  • Average time to close issues: 16 days
  • Average time to close pull requests: about 1 month
  • Total issue authors: 3
  • Total pull request authors: 5
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.28
  • Merged pull requests: 24
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • HectorJBastidasG (7)
  • darigovresearch (1)
  • omarhassan97 (1)
Pull Request Authors
  • dlsaavedra (17)
  • afariasfermin (7)
  • dependabot[bot] (3)
  • ow6n (1)
  • darigovresearch (1)
Top Labels
Issue Labels
documentation (3) good first issue (2) hacktoberfest (2) difficulty: moderate (2) enhancement (2)
Pull Request Labels
documentation (7) dependencies (3)