Skip to content

Omswastik-11/DeepLens_Tests

Repository files navigation

Dataset generation

As given in Image the dataset contains images of three class "no" ,"spherical", "vortex" substructures having 10000 training image and 2500 testing images for each class . I introduced data Augumantation technique which decreased models training accuracy overall predicting accuracy of moel is increased. It made the dataset more tough .
We applied the following transformations to preprocess the dataset:

Resize: Scales images to 150×150 pixels.
Random Horizontal Flip: Randomly flips images horizontally with a probability of 50%.
Random Vertical Flip: Randomly flips images vertically with a probability of 50%.
Random Rotation: Rotates images randomly up to ±20 degrees.
Normalize: Normalizes pixel values to have a mean of 0.5 and a standard deviation of 0.5.

Results of Common Task-1 (Multi-class classification)

On this dataset after 50 epochs the model performed very well with atraing accuracy of 95.01 % and traing accuracy of 94.80 % .

Traing Result

Testing Result

Approach for Task-1

I used three Architectures ResNet-18,EfficientNetB0,DensNet and trained each for 50 epochs on the dataset.

Model Accuracy No of Parameters Computation time ROC AUC score Colab Notbook
EfficientNetB0 94.80% 4010815 ~100min 0.9895 Link
ResNet18 90.73% 11171779 ~75min 0.9779 Link
DenseNet ~91.88% 930835 ~150min 0.9806 Link

Specific test - 5 (Physics-Informed Neural Network)

Approach-1

Approach-2

\

Model Accuracy No of Parameters Computation time ROC AUC score Colab Notbook Weights
Approach - 1 94.55% 36840447 ~180min 0.9891 Link Link
Approach - 2 93.19% 9876655 ~130min 0.9849 Link Link

Approach - 1

I used two EfficientNet networks—one as an encoder and another as a classifier.

Encoder

  1. Architecture :- It is EfficeintNetB0 architecture.
  2. Input :- It takes single channel(gray-scale) image of lens image.
  3. Output :- It produces Potential value for each coordinate.

Classifier

  1. Architecture :- It is EfficeintNetB0 architecture.
  2. Input :- It takes 2 channel(both lense and source image) image.
  3. Output :- It produces probability of class

Physics used

To Reconstruct the Source image, we use the equation for gravitational lensing, in its dimensionless form, that is given by the following relation:

$$ \begin{align} \vec{\mathcal{S}} = \vec{\mathcal{I}} - \vec{\nabla} \Psi (\vec{\mathcal{I}}) \end{align} $$

$$ \begin{align} Ψ(x_i,y_i) = Ψ_{Galaxy}(x_i,y_i) + Ψ_{DarkMatter}(x_i,y_i) \end{align} $$

The distortions caused by dark matter are localized and can be ignored in most of the formed image. Therefore, we will approximate:

$$ \begin{align} Ψ(x_i,y_i) \approx Ψ_{Galaxy}(x_i,y_i) \end{align} $$

$$ \begin{align} \boxed{Ψ(x_i,y_i) \approx k(x_i,y_i) \cdot \sqrt{x_i^2+y_i^2}} \end{align} $$

from encoder we got $$\ k(x_i,y_i)$$ which is then multiplied with position matrix to make deflection . The deflection is subtracted from the lens image to obtain the source image. Finally, the lens image and source image are concatenated and passed to the classifier, which outputs the probability for each class. ⚡️

Approach - 2

In this approach, I used image preprocessing and a converter to transform the lens image into the source image using deflection and gradient terms (referenced from last year's DeepLense repository).

Preprocess

\

Converter

\

I used encoder-decoder architecture.

Encoder

  1. Architecture:- ResNet
  2. Input:- It takes single channel(gray-scale) image of lens image.
  3. Output :- It produces Potential value for each coordinate.

Decoder

  1. Architecture:- EfficientB0
  2. Input:- It takes 3 channel image (source image,Lens image,preprocessed image) .
  3. Output:- It produces probabilities of 3 classes .

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published