
Research
/Security News
11 Malicious Go Packages Distribute Obfuscated Remote Payloads
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
The distmetrics
(or informally dist-lib
) provides a set of python tools and metrics to identify generic disturbances within OPERA RTC-S1 time-series including a transformer-based metric proposed in Hardiman-Mostow et al., 2024 [1].
The transformer metric and its application occupies most of this library in order to effectively, efficiently apply this deep-learning based model (using a visual transformer architecture).
Also, there are:
See the notebooks/
.
These notebooks show how to:
Please make sure to ensure you have an ASF account (https://search.asf.alaska.edu/#/) and set up a ~/.netrc
with:
machine urs.earthdata.nasa.gov
login <username>
password <password>
Currently there are 4 models in this library (see from distmetrics.model_load import ALLOWED_MODELS
), though you can load your own weights and config assuming the same architecture.
The models in this library are:
Please see the dist-s1-model [A] for training this transformer model and dist-s1-training-data [B] for curating a dataset from OPERA RTC-S1. There is a link in [A] to the existing dataset that was curated based on time-series with dense preimages and despeckled and masked water. In [B], you can understand how the data is curated. For the models above, here is some additional discussion:
transformer_original
- the model trained by Harris Hardiman-Mostow on the training data linked to in [A].transformer_optimized
and transformer_optimized_fine
are models with the same architecture as transformer_original
and using the same dataset in [A] by dmartinez05 with reduced size. The fine
refers to the fact that within the input size of the model (16 x 16
) there are patches used within the input size that are 4 x 4
(as opposed to 8 x 8
).transformer_anniversary_trained
and transformer_anniversary_trained_10
were trained by Jungkyo Jung using a dataset similar to one found in [B] using despeckling and some landcover masking. The context length of the the former is 20 and the latter 10.This is a python implementation of disturbance metrics for OPERA RTC-S1 data. The intention is to use this library to quantify disturbance in the RTC imagery. Specifically, our "metrics" define distances between a set of dual polarizations "pre-images" and a single dual polarization "post-image". Some of the metrics only work on single polarization imagery.
The following metrics have been implemented in this library:
It is worth noting that other metrics can be generated from the above using +
, max
, min
or linear combinations (with positive scalars). As such, when the distmetric has some auxiliary meaning (e.g. as a probability), such combinations are easier as they are more meaningfully comparable.
We recommend using the conda/mamba
package manager to install this library.
mamba install -c conda-forge distmetrics
You can also use pip
, although this doesn't ensure proper dependencies are installed.
To get the best performance of pytorch, you need to ensure pytorch recognizes the GPU.
Using conda-forge
distributions, you may require you to ensure that cudatoolkit
is installed (this is the additional library in environment_gpu.yml
).
For our servers, we needed to install cudatoolkit>=11.8
to get pytorch to recognize the GPU.
There are certain libraries that may downgrade pytorch
to use CPU only (you can check this by looking at the distribution of pytorch before installing the library).
There may be different distributions of pytorch and cuda drivers that are compatible, but providing detailed instructions is beyond the scope of these instructions.
Clone this repository and navigate to it in your terminal. We use the python package manager mamba
. We highly recommend mamba and the package repository conda-forge
to organize and manage virtual environment required for this library.
mamba env update -f environment.yml
conda activate distmetrics
pip
via pip install -e .
(-e
ensures this is editable for development)python -m ipykernel install --user --name dist-s1
.Python 3.10+ is supported. When using the transformer model, if you have gpu
available, it adviseable to check that the output from the below snippet is indeed cuda
:
from distmetrics import get_device
get_device() # should be `cuda` if GPU is available or `mps` if using mac M chips
[1] H. Hardiman Mostow et al., "Deep Self-Supervised Disturbance Mapping with Sentinel-1 OPERA RTC Synthetic Aperture Radar", https://arxiv.org/abs/2501.09129.
[2] O. L. Stephenson et al., "Deep Learning-Based Damage Mapping With InSAR Coherence Time Series," in IEEE Transactions on Geoscience and Remote Sensing, vol. 60, pp. 1-17, 2022, Art no. 5207917, doi: 10.1109/TGRS.2021.3084209. https://arxiv.org/abs/2105.11544
[3] E. J. M. Rignot and J. J. van Zyl, "Change detection techniques for ERS-1 SAR data," in IEEE Transactions on Geoscience and Remote Sensing, vol. 31, no. 4, pp. 896-906, July 1993, doi: 10.1109/36.239913. https://ieeexplore.ieee.org/document/239913
[4] Deledalle, CA., Denis, L. & Tupin, F. How to Compare Noisy Patches? Patch Similarity Beyond Gaussian Noise. Int J Comput Vis 99, 86–102 (2012). https://doi.org/10.1007/s11263-012-0519-6. https://inria.hal.science/hal-00672357/
[5] Sarem Seitz, "Probabalistic Cusum for Change Point Detection", https://web.archive.org/web/20240817203837/https://sarem-seitz.com/posts/probabilistic-cusum-for-change-point-detection/, Accessed September 2024.
[6] Tartakovsky, Alexander, Igor Nikiforov, and Michele Basseville. Sequential analysis: Hypothesis testing and changepoint detection. CRC press, 2014.
FAQs
Measure Disturbances in OPERA RTC-S1 Stacks
We found that distmetrics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).