Skip to content

Commit 512a3c9

Browse files
V3.1.0 (#158)
## Pull Request Template ### Prerequisites <!-- Take a couple of minutes to help our maintainers work faster by checking of the pre-requisites. --> <!-- To tick the checkboxes replace the space with an 'x', so [ ] becomes [x] . --> - [x] I have [searched](https://github.com/DefinetlyNotAI/Logicytics/pulls) for duplicate or closed issues. - [x] I have read the [contributing guidelines](https://github.com/DefinetlyNotAI/Logicytics/blob/main/CONTRIBUTING.md). - [x] I have followed the instructions in the [wiki](https://github.com/DefinetlyNotAI/Logicytics/wiki) about contributions. - [x] I have updated the documentation accordingly, if required. - [ ] I have tested my code with the `--dev` flag, if required. ### PR Type <!-- Take a couple of minutes to help our maintainers work faster by telling us what is the PR guided on. --> <!-- To tick the checkboxes replace the space with an 'x', so [ ] becomes [x] . --> - [x] Bug fix <!-- Non-Breaking Bug Fix - Usually relates to fixing an issue --> - [x] New feature <!-- Non-Breaking Change that adds a new feature --> - [x] Refactoring <!-- Non-Breaking Change that modifies existing code to refactor it to become more organised --> - [ ] Documentation update <!-- Non-Breaking Change that modifies existing documentation to refactor it or add extra comments - either wiki, md files or code is included here --> - [ ] ⚠️ Breaking change ⚠️ <!-- Breaking Bug Fix / New Addition that changes how Logicytics works --> ### Description <!-- REQUIRED: Provide a summary of the PR and what you expected to happen. --> CodeRabbit will supply this ### Motivation and Context <!-- REQUIRED: Why is this PR required? What problem does it solve? Why do you want to do it? --> To maintain v3 ### Credit <!-- If this PR is a contribution, please mention the contributors here using the appropriate syntax. --> <!-- ### File-Created/CONTRIBUTION by MAIN-Username What you did, created, removed, refactored, fixed, or discovered. - [Your GitHub Username](https://github.com/YourGitHubLink) - [Your GitHub Username](https://github.com/YourGitHubLink) etc... --> _N/A_ ### Issues Fixed <!-- REQUIRED: What issues will be fixed? (Format: "#50, #23" etc.) if none exist type _N/A_ --> _N/A_ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a framework for visualizing neural network models and their features. - Added functionality to capture and log system memory information. - Enhanced scanning functionality for files and directories for sensitive content. - Added new entries to the `.gitignore` file for improved file management. - Implemented a global locking mechanism for thread safety during model and vectorizer usage. - Added a new section in the configuration file for study parameters. - **Bug Fixes** - Improved error handling and logging in various scripts. - **Documentation** - Updated documentation for VulnScan to include new repository details and resources. - Enhanced the `README.md` for better clarity and usability. - **Chores** - Updated configuration file to reflect new settings for model and vectorizer paths. - Modified `requirements.txt` to add and remove several package dependencies. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 9e1f65a + 62da785 commit 512a3c9

19 files changed

+1486
-322
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,4 @@ $RECYCLE.BIN/
319319
*.pyc
320320
/CODE/SysInternal_Suite/.sys.ignore
321321
/ACCESS/
322+
/CODE/VulnScan/tools/NN features/

.idea/Logicytics.iml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CODE/Logicytics.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
# Initialization
1717
FileManagement.mkdir()
1818
log = Log({"log_level": DEBUG, "delete_log": DELETE_LOGS})
19+
ACTION = None
20+
SUB_ACTION = None
1921

2022

2123
class Health:
2224
@staticmethod
23-
@log.function
2425
def backup(directory: str, name: str):
2526
"""
2627
Creates a backup of a specified directory by zipping its contents and moving it to a designated backup location.
@@ -47,7 +48,6 @@ def backup(directory: str, name: str):
4748
shutil.move(f"{name}.zip", "../ACCESS/BACKUP")
4849

4950
@staticmethod
50-
@log.function
5151
def update() -> tuple[str, str]:
5252
"""
5353
Updates the repository by pulling the latest changes from the remote repository.
@@ -325,9 +325,13 @@ def threaded_execution(execution_list_thread, index_thread):
325325

326326
def zip_generated_files():
327327
"""Zips generated files based on the action."""
328-
329-
def zip_and_log(directory, name):
330-
zip_values = FileManagement.Zip.and_hash(directory, name, ACTION)
328+
def zip_and_log(directory: str, name: str):
329+
log.debug(f"Zipping directory '{directory}' with name '{name}' under action '{ACTION}'")
330+
zip_values = FileManagement.Zip.and_hash(
331+
directory,
332+
name,
333+
ACTION if ACTION is not None else f"ERROR_NO_ACTION_SPECIFIED_{datetime.now().isoformat()}"
334+
)
331335
if isinstance(zip_values, str):
332336
log.error(zip_values)
333337
else:

CODE/VulnScan/Documentation.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,32 @@ VulnScan is designed to detect sensitive data across various file formats. It of
107107
- **Progress Tracking**: Visualizes accuracy and loss per epoch with graphs.
108108
- **Error Handling**: Logs errors for missing files, attribute issues, or unexpected conditions.
109109
- **Extensibility**: Supports plug-and-play integration for new algorithms or datasets.
110+
111+
112+
# More files
113+
114+
There is a repository that archived all the data used to make the model,
115+
as well as previously trained models for you to test out
116+
(loading scripts and vectorizers are not included).
117+
118+
The repository is located [here](https://github.com/DefinetlyNotAI/VulnScan_TrainingData).
119+
120+
The repository contains the following directories:
121+
- `Training Data`: Contains the data used to train the models. Is organized by the file size and amount, unless its Tests, where they explicitly say text.
122+
- `Archived Models`: Contains the previously trained models. Is organized by the model type then version.
123+
- `NN features`: Contains information about the model `.3n3` and the vectorizer used. Information include:
124+
- `Documentation_Study_Network.md`: A markdown file that contains more info.
125+
- `Neural Network Nodes Graph.gexf`: A Gephi file that contains the model nodes and edges.
126+
- `Nodes and edges (GEPHI).csv`: A CSV file that contains the model nodes and edges.
127+
- `Statistics`: Directories made by Gephi, containing the statistics of the model nodes and edges.
128+
- `Feature_Importance.svg`: A SVG file that contains the feature importance of the model.
129+
- `Loss_Landscape_3D.html`: A HTML file that contains the 3D loss landscape of the model.
130+
- `Model Accuracy Over Epochs.png` and `Model Loss Over Epochs.png`: PNG files that contain the model accuracy and loss over epochs.
131+
- `Model state dictionary.txt`: A text file that contains the model state dictionary.
132+
- `Model Summary.txt`: A text file that contains the model summary.
133+
- `Model Visualization.png`: A PNG file that contains the model visualization.
134+
- `Top_90_Features.svg`: A SVG file that contains the top 90 features of the model.
135+
- `Vectorizer features.txt`: A text file that contains the vectorizer features.
136+
- `Visualize Activation.png`: A PNG file that contains the visualization of the model activation.
137+
- `Visualize t-SNE.png`: A PNG file that contains the visualization of the model t-SNE.
138+
- `Weight Distribution.png`: A PNG file that contains the weight distribution of the model.

0 commit comments

Comments
 (0)