![]() This LinkedBlockingQueue gets sequences from the iterator of training text and provides these sequences to each thread. getRandom().setSeed(configuration.getSeed()) // Nd4j initializes a random matrix for syn0 syn0 = Nd4j.rand(new int Queue that provides sequences to every thread to train Here, the syn0 is the model weights, and it is initialized by Nd4j.rand // Nd4j takes seed configuration here Nd4j. Here is the place where the seed takes effect. Hence, if we set the seed as 0, we will get the exact same initialization every time. ![]() We know that before training, the weights of a model and vector representation will be initialized randomly, and the randomness is controlled by seed. Where the randomness comes The initialization of model weights and vector representation ![]() If you want to take look on the other package, go to gensim’s doc2vec, which has the same method of implementation. I will use DL4j’s implementation of paragraph vectors to show the code. The code can talk itself, let’s take a look at where the randomness comes and how to eliminate it thoroughly. This is because of the randomness introduced in the training time. Our experimental results show that the proposed AST features and Doc2Vec for feature learning provide better accuracy and fast classification in malicious JS codes detection compared to conventional approaches and can flag malicious JS codes previously identified as hard-to-detect.If you got any chance to train word vectors yourself, you may find that the model and the vector representation are different across every training even you feed into the same training data. We then compare the performance of Doc2Vec on plain JS codes (Plain-JS) and AST form of JS codes (AST-JS) to other feature learning methods. The performance of this approach is evaluated using the D3M dataset (Drive-by-Download Data by Marionette) for malicious JS codes and the JSUNPACK plus Alexa top 100 websites datasets for benign JS codes. A classifier model judges the maliciousness of a JS code using the learned features. Besides, features learned with Doc2Vec are of low dimensions which ensure faster detections. This model is a well-suited feature learning method for JS codes, which consist of text content ranging among single line sentences, paragraphs, and full-length documents. Doc2vec is a neural network model that can learn context information of texts with variable length. This study adopts Abstract Syntax Tree (AST) for code structure representation and a machine learning approach to conduct feature learning called Doc2vec to address this issue. It is, therefore, primal to develop an accurate detection system for malicious JS to protect users from such attacks. Many of the recent cyber-attacks exploit JS vulnerabilities, in some cases employing obfuscation to hide their maliciousness and evade detection. These exploits use methods such as drive-by-downloads, pop up ads, and phishing attacks on news, porn, piracy, torrent or free software websites, among others. The exploitation of vulnerabilities in servers, plugins, and other third-party systems enables the insertion of malicious codes into websites. Most of these websites use JavaScript (JS) to create dynamic content. Websites attract millions of visitors due to the convenience of services they offer, which provide for interesting targets for cyber attackers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |