Coder Social home page Coder Social logo

santoshpanda1995 / lightweightgcn-model Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 7.64 MB

A very fast and lightweight model based on graph convolutional network (GCN) for Low Light Image Enhancement (LLIE)

cnn-keras gcn graph graphconvolution imageenhancement keras keras-tensorflow lightweightnetwoks lowlightenhancement pixelshuffle real-time tensorflow inversepixelshuffle computer-vision denoising image-processing low-light-image-enhancement machine-learning neural-network python

lightweightgcn-model's Introduction

LightweightGCN-Model

A very fast and lightweight model based on Graph Convolutional Network (GCN) for Low Light Image Enhancement (LLIE). It only contains 0.32M parameters; in comparison, if we use a UNet of some depth, then it will take 1.92M parameters. We have not used any pooling layer for down/upsampling our convolution layers, rather, we have used a unique pixelshuffle and inverse pixelshuffle mechanism. Our model is best suited for real-time applications.

To cite:

@article{panda2024integrating,
  title={Integrating Graph Convolution into a Deep Multi-Layer Framework for Low-light Image Enhancement},
  author={Panda, Santosh Kumar and Sa, Pankaj Kumar},
  journal={IEEE Sensors Letters},
  year={2024},
  publisher={IEEE}
}

Fig: Results of our approach, where we compared to the original low light image and our enhanced image.


Here I am giving the steps to be followed in Google colab.

  1. To run in colab, first of all clone this repo
!git clone https://github.com/santoshpanda1995/LightweightGCN-Model.git

The requirements.txt file contains all the library files needed for the program to run.

  1. Then copy the contents of requirements.txt and just run in a cell in colab.

Note: There may be some extra or repeated library files present in the requirements file, usually I maintain a single requirement file so sometimes i copy the existing command which may already be there. It will never effect anything to the program.

  1. We have used pixelshuffle and inverse pixelshuffle mechanism for down/upsampling.

  2. After that we have to load our trained model, you can directly download the pretrained model which I have provided and put it in the colab to import it.

  • LightweightGCN.h5 ( Our pretrained model, trained on our synthetic paired dataset, for 1000 epochs with 32 steps per epoch. Adam Optimizer and L1 loss function has been used.)
from tensorflow.keras.models import load_model
# load model
Model = load_model(path to the model)
# summarize model
Model.summary()

Now our model is loaded in Model. , We can test low light images from this model. Some of the low light images on which i have tested my model , I will provide here.

  1. To test image, define this function
from google.colab.patches import cv2_imshow
import cv2
def test(img,og):
  height, width, channels = img.shape
  image_for_test= cv.resize(img,(600,400))
  og= cv.resize(og,(600,400))
  image_for_test= image_for_test[np.newaxis,:, :,:]
  Prediction = Model.predict(image_for_test)
  Prediction = Prediction.reshape(400,600,3)
  Prediction = np.array(Prediction)
  #Write the Low light image, the predictiona image and groundtruth image
  cv2.imwrite('root path', img)
  cv2.imwrite('root path', Prediction)
  cv2.imwrite('root path', og)
  original = cv2.imread("/content/low.png")
  compressed = cv2.imread("/content/high.png")
  Hori = np.concatenate((cv.resize(img,(600,400)),cv.resize(og,(600,400)),cv.resize(Prediction,(600,400))), axis=1)
  cv2_imshow(Hori)
  1. Then
img = cv.imread(path of low light image)
og = cv.imread(path of groundtruth image)
test(img,og)

The above is published in IEEE Sensors Letters, to cite :

@article{panda2024integrating,
  title={Integrating Graph Convolution into a Deep Multi-Layer Framework for Low-light Image Enhancement},
  author={Panda, Santosh Kumar and Sa, Pankaj Kumar},
  journal={IEEE Sensors Letters},
  year={2024},
  publisher={IEEE}
}

lightweightgcn-model's People

Contributors

santoshpanda1995 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.