Stock price fluctuation prediction system and method for controlling stock price fluctuation prediction system

The stock price fluctuation prediction system addresses the limitations of existing models by incorporating a hierarchical self-association module that leverages industrial classifications to enhance correlation capture and prediction accuracy, thereby improving overall performance and efficiency.

WO2025070899A1PCT designated stage expired Publication Date: 2025-04-03FOUND OF SOONGSIL UNIV IND COOP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2023/021827
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-25
Filing Date
2023-12-28
Publication Date
2025-04-03

AI Technical Summary

Technical Problem

Existing deep learning models for predicting stock price fluctuations primarily focus on specific stock data without considering correlations between various stocks or industrial classifications, leading to suboptimal performance.

Method used

A stock price fluctuation prediction system that utilizes a hierarchical self-association module to extract final time series pattern vectors based on industrial classifications, enhancing the capture of correlations between stocks and improving prediction accuracy.

Benefits of technology

The system significantly improves stock price fluctuation forecast performance by considering industrial correlations, while also reducing data processing time and memory requirements compared to conventional systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2023021827_03042025_PF_FP_ABST
    Figure KR2023021827_03042025_PF_FP_ABST
Patent Text Reader

Abstract

The stock price fluctuation prediction system according to an embodiment of the disclosed invention may comprise: a time series encoder configured to extract initial time series pattern vectors for each of a plurality of stock items by using a first machine learning model on the basis of stock price data; a hierarchical self-attention module configured to extract final time series pattern vectors for each of the stock items by using a second machine learning model; and a stock price prediction module configured to predict a stock price change for each of the stock items on the next day of the last day of a preset period for each of the stock items, by using a third machine learning model.
Need to check novelty before this filing date? Find Prior Art

Description

Stock price fluctuation prediction system and control method of the stock price fluctuation prediction system

[0001] The present invention relates to a stock price fluctuation prediction system that predicts the fluctuation of stock prices.

[0002] The present invention was derived from research conducted as part of the Ministry of Science and ICT's Information and Communication Broadcasting Innovation Talent Training Project (Project Unique Number: 1711179353, Project Number: RS-2022-00156360, Research Project Name: Regional Intelligence Innovation Talent Training, Project Management Agency: Information and Communication Planning Evaluation Institute, Project Execution Agency: Soongsil University Industry-Academic Cooperation Foundation, Research Period: January 1, 2023 - December 31, 2023). Meanwhile, the Korean government has no property interest in any aspect of the present invention.

[0003] Recently, techniques that utilize statistical or deep learning models to predict stock price fluctuations using past stock price data have become widely used. Compared to statistical models, deep learning models excel at capturing complex patterns in stock price data.

[0004] However, most existing methods using deep learning models suffer from the problem of using only data from specific stocks, without considering the correlations between multiple stocks. Furthermore, even when data from multiple stocks is used, information about the industry to which the stock belongs is not considered, making it difficult to capture the overall influence of a specific industry.

[0005] The present invention provides a stock price fluctuation prediction system capable of predicting stock price fluctuations by capturing correlations between stocks according to industry classification.

[0006] In addition, the present invention provides a stock price fluctuation prediction system that can improve stock price fluctuation prediction performance compared to existing methods that do not utilize industry classification, and can further improve prediction performance in a structural manner for future models.

[0007] In addition, the present invention provides a stock price fluctuation prediction system that can improve performance, such as increasing data processing speed or reducing required memory capacity, compared to conventional systems.

[0008] A stock price fluctuation prediction system according to one aspect of the disclosed invention may include: a time series encoder configured to extract initial time series pattern vectors for each of a plurality of stocks using a first machine learning model based on stock price data including at least one of an opening price, a high price, a low price, and a closing price for dates of a preset period of a plurality of stocks; a hierarchical self-attention module configured to extract final time series pattern vectors for each of the stocks using a second machine learning model based on the initial time series pattern vectors for each of the stocks and a preset industry classification for each of the stocks; and a stock price prediction module configured to predict a stock price fluctuation for each of the stocks on the day following the last day of the preset period for each of the stocks using a third machine learning model based on the final time series pattern vectors for each of the stocks.

[0009] In addition, the system may further include a first machine learning unit that sets the stock price data for learning of each stock as an input variable, sets the initial time series pattern vector for learning corresponding to the stock price fluctuation prediction data for learning of the stocks as an output variable, and learns the first machine learning model through a machine learning method based on a hierarchical transformer based on the initial time series pattern vector corresponding to the actual stock price fluctuation result data of the stocks.

[0010] In addition, the second machine learning unit may further include a second machine learning unit that sets the initial time series pattern vectors for learning of each stock extracted based on the learning stock price data of each stock and the industry classification of each stock as input variables, sets the learning stock price fluctuation prediction data of the stocks corresponding to the final time series pattern vectors for learning output based on the initial time series pattern vectors for learning as output variables, and learns the second machine learning model through a hierarchical transformer-based machine learning method based on the actual stock price fluctuation result data of the stocks.

[0011] In addition, the hierarchical self-attention module is configured to: determine the similarity between the initial time series pattern vector of the operation target stock, which is one of the stocks, and the initial time series pattern vector of the other stock; calculate a weight of the operation target stock and the weights of the other stocks based on the similarity between the initial time series pattern vectors of each of the other stocks for the operation target stock; and extract a final time series pattern vector for the operation target stock based on the weight of the operation target stock, the initial time series pattern vector of the operation target stock, the weights of the other stocks, and the initial time series pattern vectors of the other stocks, wherein each of the other stocks may be one of stocks other than the operation target stock.

[0012] In addition, the hierarchical self-attention module is configured to: determine the similarity between the initial time series pattern vector of the target stock and the initial time series pattern vector of the first other stock; calculate a weight of the target stock and the weights of the first other stocks based on the similarity between the initial time series pattern vectors of each of the first other stocks for the target stock; extract a first time series pattern vector for the target stock using the second machine learning model based on the weight of the target stock, the initial time series pattern vector of the target stock, the weights of the first other stocks, and the initial time series pattern vectors of the first other stocks; and extract final time series pattern vectors for each of the stocks using the second machine learning model based on the first time series pattern vectors of each of the stocks, wherein each of the first other stocks may be one of stocks that are pre-classified into the same industry as the target stock except for the target stock.

[0013] In addition, the hierarchical self-attention module: after extracting the first time series pattern vector for all stocks, determines the similarity between the first time series pattern vector of the target stock and the first time series pattern vector of the second other stock; calculates a weight of the target stock and the weights of the second other stocks based on the similarity between the first time series pattern vectors of each of the second other stocks for the target stock; and extracts a second time series pattern vector for the target stock using the second machine learning model based on the weight of the target stock, the first time series pattern vector of the target stock, the weights of the second other stocks, and the first time series pattern vectors of the second other stocks. And, based on the second time series pattern vector of each of the above items, the second machine learning model is configured to extract final time series pattern vectors for each of the above items, and each of the second other items is one of the items pre-classified into the same industrial sector as the above operation target item, excluding the operation target item, and each of the above industrial sectors may be a set of multiple industries pre-set to be industrially related to each other.

[0014] In addition, the hierarchical self-attention module may be configured to: extract the second time series pattern vectors for all stocks, and then determine the similarity between the second time series pattern vector of the target stock and the second time series pattern vectors of all other stocks; calculate a weight of the target stock and the weights of the other stocks based on the similarity between the second time series pattern vectors of each of the other stocks for the target stock; and extract a final time series pattern vector for the target stock using the second machine learning model based on the weight of the target stock, the second time series pattern vector of the target stock, the weights of the other stocks, and the second time series pattern vectors of the other stocks.

[0015] In addition, the hierarchical self-attention module: calculates the weight of the operation target item and the weights of the first other items for the operation target item, such that the higher the similarity between the initial time series pattern vectors for the operation target item of each of the first other items, the higher the weight of each of the first other items for the operation target item, and the sum of the weights of the operation target item and all the first other items becomes 1; calculates the weight of the operation target item and the weights of the second other items for the operation target item, such that the higher the similarity between the first time series pattern vectors for the operation target item of each of the second other items, the higher the weight of each of the second other items for the operation target item, and the sum of the weights of the operation target item and all the second other items becomes 1; And, as the similarity between the second time series pattern vectors for the target stock of each of the other stocks increases, the weight of each of the other stocks for the target stock of the operation increases, and the weight of the target stock of the operation and the weights of the other stocks for the target stock of the operation can be configured to be calculated so that the sum of the weights of the target stock of the operation and the weights of all other stocks for the target stock of the operation becomes 1.

[0016] A control method of a stock price fluctuation prediction system according to one aspect of the disclosed invention comprises the steps of: extracting initial time series pattern vectors for each of a plurality of stocks using a first machine learning model based on stock price data including at least one of an opening price, a high price, a low price, and a closing price for dates of a preset period of a plurality of stocks by a time series encoder; extracting final time series pattern vectors for each of the stocks using a second machine learning model based on the initial time series pattern vectors of each of the stocks and a preset industry classification for each of the stocks by a hierarchical self-attention module; And a step of predicting a stock price fluctuation of each of the stocks on the day after the last day of the preset period for each of the stocks by using a third machine learning model based on the final time series pattern vectors of each of the stocks by a stock price prediction module, wherein the step of extracting the final time series pattern vectors for each of the stocks comprises: a step of determining, by the hierarchical self-attention module, a similarity between an initial time series pattern vector of a target stock, which is one of the stocks, and an initial time series pattern vector of a first other stock; a step of calculating, by the hierarchical self-attention module, a weight of the target stock and weights of the first other stocks for the target stock based on the similarity between the initial time series pattern vectors of each of the first other stocks for the target stock; A step of extracting a first time series pattern vector for the operation target item using the second machine learning model based on the weight of the operation target item, the initial time series pattern vector of the operation target item, the weights of the first other items, and the initial time series pattern vector of the first other items by the hierarchical self-attention module;A step of extracting the first time series pattern vector for all stocks by the hierarchical self-attention module, and then determining the similarity between the first time series pattern vector of the target stock and the first time series pattern vector of the second other stock; A step of calculating a weight of the target stock and the weights of the second other stocks based on the similarity between the first time series pattern vectors of the target stock for each of the second other stocks by the hierarchical self-attention module; A step of extracting a second time series pattern vector for the target stock by the hierarchical self-attention module using the second machine learning model based on the weight of the target stock, the first time series pattern vector of the target stock, the weights of the second other stocks, and the first time series pattern vectors of the second other stocks; A step of extracting the second time series pattern vectors for all stocks by the hierarchical self-attention module, and then determining the similarity between the second time series pattern vectors of the stock to be operated and the second time series pattern vectors of all other stocks; A step of calculating the weight of the stock to be operated and the weights of other stocks based on the similarity between the second time series pattern vectors of each of the other stocks for the stock to be operated by the hierarchical self-attention module;And a step of extracting a final time series pattern vector for the operation target stock using the second machine learning model based on the weight of the operation target stock, the second time series pattern vector of the operation target stock, the weights of the other stocks, and the second time series pattern vectors of the other stocks by the hierarchical self-attention module, wherein each of the other stocks is one of stocks other than the operation target stock, each of the first other stocks is one of stocks pre-classified into the same industry as the operation target stock excluding the operation target stock, each of the second other stocks is one of stocks pre-classified into the same industrial sector as the operation target stock excluding the operation target stock, and each of the industrial sectors may be a set of a plurality of industries pre-set to be industrially related to each other.;

[0017] A computer program according to one aspect of the disclosed invention can be stored in a computer-readable, non-transitory recording medium to execute a control method of the stock price fluctuation prediction system.

[0018] According to one aspect of the disclosed invention, stock price fluctuations can be predicted by capturing correlations between stocks according to industry classification.

[0019] In addition, according to an embodiment of the present invention, stock price fluctuation prediction performance can be improved compared to existing methods that do not utilize industry classification, and prediction performance can be further improved in a structural manner for future models.

[0020] In addition, according to an embodiment of the present invention, performance such as an increase in data processing speed or a decrease in required memory capacity can be improved compared to a conventional system.

[0021] FIG. 1 is a diagram illustrating a stock price fluctuation prediction system according to one embodiment.

[0022] FIG. 2 is a diagram for explaining time series pattern vectors extracted according to one embodiment.

[0023] FIG. 3 is a drawing for explaining a mask matrix used according to one embodiment.

[0024] FIG. 4 is a diagram for explaining a method of extracting a time series pattern vector in each layer according to one embodiment.

[0025] Fig. 5 is a flowchart of a control method of a stock price fluctuation prediction system according to one embodiment.

[0026] Figure 6 is a graph showing the results of an experiment using a stock price fluctuation prediction system according to one embodiment.

[0027] Figure 7 is a table showing the results of an experiment using a stock price fluctuation prediction system according to one embodiment.

[0028] Like reference numerals refer to like elements throughout the specification. This specification does not describe all elements of the embodiments, and general information within the technical field to which the disclosed invention pertains or information that overlaps between the embodiments is omitted.

[0029] Additionally, when a part is said to "include" a component, this does not mean that it excludes other components, but rather that it may include other components, unless otherwise specifically stated.

[0030] As used herein, the term "~unit" refers to a unit that processes at least one function or operation, and may refer to, for example, software, an FPGA, or a hardware component. The function provided by the "~unit" may be performed separately by multiple components, or may be integrated with other additional components. The "~unit" of this specification is not necessarily limited to software or hardware, and may be configured to be located in an addressable storage medium, or may be configured to play back one or more processors. According to embodiments, multiple "~units" may be implemented as a single component, or a single "~unit" may include multiple components.

[0031] The terms first, second, etc. are used to distinguish one component from another, and the components are not limited by the aforementioned terms.

[0032] Singular expressions include plural expressions unless the context clearly indicates otherwise.

[0033] The identification codes for each step are used for convenience of explanation and do not describe the order of each step. Each step may be performed in a different order than specified unless the context clearly indicates a specific order.

[0034] The operating principle and embodiments of the disclosed invention are described below with reference to the attached drawings.

[0035] FIG. 1 is a diagram illustrating a stock price fluctuation prediction system according to one embodiment.

[0036] Referring to FIG. 1, the stock price fluctuation prediction system (100) may be a system configured to predict stock price fluctuations of input stocks based on stock price data of the corresponding stocks.

[0037] The stock price data for each stock may include at least one of the following: opening price, high price, low price, and closing price for each day during a preset period. For example, if the preset period is five days, the stock price data for a given stock may include the opening price, high price, low price, and closing price for each day within the last five trading days. In this case, the stock price fluctuation prediction system (100) receives stock price data for the subject stock and all other stocks over the five trading days and can predict stock price fluctuations, such as whether the subject stock price will rise, fall, or remain stable, on the following day.

[0038] The stock price fluctuation prediction system (100) is installed on a server and can communicate with at least one user terminal via wired or wireless means. The user terminal may be a terminal used by a user who wishes to obtain information on stock price fluctuations of a target stock for analysis using the stock price fluctuation prediction system (100). Furthermore, the stock price fluctuation prediction system (100) does not necessarily need to be installed on a server. The stock price fluctuation prediction system (100) may be installed on a user terminal by downloading and installing an application for the stock price fluctuation prediction system (100) from a server.

[0039] A stock price fluctuation prediction system (100) may include a time series encoder (110), a hierarchical self-attention module (120), a stock price prediction module (130), a memory (140), a first machine learning unit (151), and a second machine learning unit (152).

[0040] A time series encoder (110) can receive stock price data. The stock price data may be time series data including at least one of the opening price, high price, low price, and closing price for a preset period of time for multiple stocks.

[0041] The time series encoder (110) can extract initial time series pattern vectors (201) for each of a plurality of stocks based on stock price data using a first machine learning model (141). The first machine learning model (141) may be a deep learning model pre-trained using a machine learning method based on a hierarchical transformer. The time series encoder (110) can transmit the initial time series pattern vectors (201) for each of the plurality of stocks to the hierarchical self-attention module (120).

[0042] Stocks included in the time-series data input into the stock price fluctuation prediction system (100) may each fall into a specific industry classification based on their main products or services. For example, stock "A Heavy Industries" may fall into the shipbuilding industry, while stock "B Motors" may fall into the automobile industry. The stock price fluctuation prediction system (100) may learn or utilize a hierarchical transformer-based deep learning model that predicts stock prices by considering the industry classifications of these stocks and reflecting the correlations among the stocks.

[0043] The hierarchical self-attention module (120) can extract final time-series pattern vectors (202) for each stock using a second machine learning model (142) based on the initial time-series pattern vectors (201) of each stock and the pre-set industry classification for each stock. The second machine learning model (142) can be a deep learning model that has been pre-trained using a hierarchical transformer-based machine learning method. The hierarchical self-attention module (120) can transmit the final time-series pattern vectors (202) for each of a plurality of stocks to the stock price prediction module (130).

[0044] The stock price prediction module (130) can predict the stock price fluctuations of each stock on the day following the last day of the preset period for each stock based on the final time series pattern vector (202) of each stock using a third machine learning model. The third machine learning model may be a pre-trained deep learning model that uses the learning time series pattern vector as an input variable and the actual stock price movement data of each stock corresponding to the learning time series pattern vector as an output variable.

[0045] The stock price prediction module (130) can output predicted stock price fluctuation prediction information. In this case, the stock price fluctuation prediction information may be prediction information regarding whether the stock prices of the stocks included in the stock price data will rise, remain constant, or fall on the day following the last date included in the stock price data.

[0046] The training stock price data may be pre-labeled stock price data indicating the stock price of each stock on the day following the last date included in the stock price data. The training time series pattern vector may be a time series pattern vector generated by a time series encoder (110) based on the training stock price data.

[0047] The first machine learning unit (151) sets the learning stock price data of each stock as an input variable, and sets the learning initial time series pattern vector (201) corresponding to the learning stock price fluctuation prediction data of the stocks as an output variable, so that the first machine learning model (141) can be learned through a hierarchical transformer-based machine learning method based on the initial time series pattern vector (201) corresponding to the actual stock price fluctuation result data of the stocks.

[0048] The second machine learning unit (152) sets the learning initial time series pattern vector (201) of each stock extracted based on the learning stock price data of each stock and the industry classification of each stock as input variables, and sets the learning stock price fluctuation prediction data of the stocks corresponding to the learning final time series pattern vectors (202) output based on the learning initial time series pattern vectors (201) as output variables, so that the second machine learning model (142) can be learned through a machine learning method based on a hierarchical transformer based on the actual stock price fluctuation result data of the stocks.

[0049] Machine learning utilizes models composed of multiple parameters and can mean optimizing those parameters based on given data. Depending on the type of learning problem, machine learning can include supervised learning, unsupervised learning, and reinforcement learning. Supervised learning learns mappings between inputs and outputs and is applicable when input-output pairs are given as data. Unsupervised learning is applicable when there are only inputs and no outputs, and can identify patterns between inputs, etc.

[0050] For example, the first machine learning unit (151) and the second machine learning unit (152) can learn features extracted from learning stock price data or learning time series pattern vectors, respectively, using a deep learning-based learning method. At this time, a hierarchical transformer structure using multiple layers can be utilized to learn a method of extracting features from learning data, but the learning methods of the first machine learning unit (151) and the second machine learning unit (152) are not necessarily limited to a method utilizing a hierarchical transformer structure.

[0051] A hierarchical transformer architecture comprises the basic components of a transformer, and these components can be applied hierarchically. A hierarchical transformer is typically constructed by stacking multiple transformer encoder layers. Each encoder layer embeds input data and can model relationships between elements of the input sequence using self-attention. These encoder layers can extract information at lower levels in the hierarchical structure and pass it on to higher levels.

[0052] In the subsequent attention weight calculation step, the attention weight can be calculated through a self-attention mechanism in the transformer model. At each encoder layer, each token in the input sequence can calculate an attention weight representing its interaction with other tokens. The calculated weight determines how each element in the input data interacts with other elements, and a new embedding vector can be generated based on this information. Hierarchical transformers can achieve various levels of abstraction by stacking encoders and attention mechanisms in multiple layers. In other words, the hierarchical transformer approach can help perform deep learning by considering the diverse hierarchical characteristics of the input data.

[0053] Calculating attention weights is a core part of the transformer model, which can be a process of calculating how each token of the input data is related to other tokens.

[0054] In the process of calculating attention weights, each token in the input sequence first undergoes an initial embedding process, which allows it to be represented as a vector. These embeddings serve as learnable parameters for the model and can convert the meaning of the input data into numeric vectors.

[0055] In the Key, Query, and Value generation steps, token representations can be transformed into three sets for calculating attention weights. The Query is a vector containing information about the current token, the Key is a vector containing information about all other tokens, and the Value can be the value corresponding to each key.

[0056] In the process of performing Scaled Dot-Product Attention, the inner product between the query and the key is calculated, and then the softmax function can be applied to obtain the attention weight. This process can be expressed by the following formula.

[0057]

[0058] Here, Q can be the query vector, K can be the key vector, V can be the value vector, and dk can be the dimensionality of the key vector.

[0059] In the step of combining attention weights and values, attention weights can be applied to the value vector to calculate a weighted average. This creates a new representation for each query. That is, the representation can be created as Attention(Q,K,V) = Attention Weights x Value(V).

[0060] In practice, it may be common in transformers to perform attention operations by splitting them into multiple different attention heads. In the multi-head attention stage, each attention head has different parameters, allowing the model to independently learn various relationships in the input data. The results of this multi-head attention can then be combined. Using the attention weights calculated in this way, a weighted average can be calculated for each token in the input sequence, generating a new representation that can be used in subsequent layers to perform various operations.

[0061] FIG. 2 is a diagram for explaining time series pattern vectors extracted according to one embodiment.

[0062] Referring to FIGS. 1 and 2, the hierarchical self-attention module (120) can determine the similarity between the initial time series pattern vector (201) of the target stock and the initial time series pattern vector (201) of another stock. The similarity between a pair of initial time series pattern vectors (201) can be the inner product value between a query and a key.

[0063] The target stock may be one of the stocks included in the stock price data, and the other stock may be a stock not included in the stock price data. In other words, each other stock may be one of the stocks not included in the calculation.

[0064] All items become the target item of the calculation at least once during the calculation process of the hierarchical self-attention module (120), and can become another item when another item becomes the target item of the calculation. In other words, even if a certain item becomes the target item of the calculation once, it is not always the target item of the calculation. If another item becomes the target item of the calculation, it becomes another item, and when calculation is performed again in another layer, it becomes the target item of the calculation again, and can become another item when another item becomes the target item of the calculation.

[0065] The hierarchical self-attention module (120) can calculate the weight of the operation target item and the weights of other items for the operation target item based on the similarity between the initial time series pattern vectors (201) for each operation target item of other items.

[0066] The hierarchical self-attention module (120) can extract a final time series pattern vector (202) for the target stock based on the weight of the target stock, the initial time series pattern vector (201) of the target stock, the weights of other stocks, and the initial time series pattern vectors (201) of other stocks.

[0067] FIG. 3 is a drawing for explaining a mask matrix used according to one embodiment.

[0068] Referring to FIG. 3, the process of performing a hierarchical self-attention operation in the hierarchical self-attention module (120) can be confirmed.

[0069] The problem of predicting stock price fluctuations is the time series data of stock s up to point T ( ), and the stock price fluctuation on day T+1 compared to day T When (1: rising, 0: falling), time series data of N stocks ( ) from the stock price fluctuations of each stock ( ) predicting parameters ( ) consisting of a prediction function ( ) is to learn stock price fluctuations ( ) can be defined as rising if the adjusted closing price on day T+1 is higher than the adjusted closing price on day T of stock s, and falling if it is lower, but is not limited thereto.

[0070] Stock price data has attributes such as opening, high, low, and closing prices, and is composed of time-series data over a certain period. Accordingly, the time-series encoder (110) can utilize the encoder portion of the transformer to encode information on each stock item.

[0071] In order to input the time series data of each stock item into the time series encoder (110), the data of stock item s at time t as in [Equation 1] ( ) can re-express the data through a fully connected layer passing through the tanh activation function. At this time, are learnable weights may be a learnable deviation.

[0072]

[0073] [Equation 1]

[0074]

[0075]

[0076] After that query( ) and key( ) and the value created through this ( ) with the same input data ( ) and perform self-attention as in [Equation 2], and then the data at time T ( ) can be created.

[0077]

[0078] [Equation 2]

[0079]

[0080]

[0081] Each stock belongs to a specific industry (Industry), and each industry belongs to a specific industry sector (Sector). The industry classification-based hierarchical self-attention used in the stock price fluctuation prediction system (100) hierarchically organizes the differences in the industry classification of stocks into three blocks, and a mask matrix M can be used to train each block in the order of "Industry -> Industry Sector -> All." However, the number of blocks being three is just an example, and the number of blocks can vary depending on how many levels the hierarchy is divided into based on the industry classification.

[0082] The hierarchical self-attention module (120) is generated from the time series encoder (110). From this, we can generate a query (Q), a key (K), and a value (V) generated through them. After that, we can capture the correlation hierarchically by adding M to the self-attention of the Bth block as in [Equation 3].

[0083]

[0084] [Equation 3]

[0085]

[0086]

[0087] Here, the mask matrix M is a matrix with a size of NХN when the number of stock items s is N, and can function to mask information outside the same industry or industrial sector in each block. M is configured with 0 as the value for the diagonal matrix corresponding to the position of the same industry or industrial sector, and -inf as the other values, in order to exclude information outside the same industry or industrial sector when calculating the softmax function. In the first block, for M1, when the number of stock items with a specific industry i is ni (i = 1, 2, ..., I, I = total number of industries), M is configured as in (a) of Fig. 3, and M2 can also be configured as in (b) of Fig. 3 for the total number of industrial sectors S in the same manner. Since M3 must perform self-attention for all stock items, all values ​​can be configured as 0.

[0088] That is, the stock price fluctuation prediction system (100) extracts time series data of each stock item through a time series encoder (110) as illustrated in FIG. 2, hierarchically captures correlations between stock items through industry-based hierarchical self-attention, and then outputs the probability that the stock price fluctuation of each stock item will be an increase through a prediction layer, which is a fully connected layer that passes through a sigmoid activation function.

[0089] FIG. 4 is a diagram for explaining a method of extracting a time series pattern vector in each layer according to one embodiment.

[0090] Referring to FIG. 1, FIG. 2 and FIG. 4, the relationship between the time series pattern vector (220) of the target item to be operated, the time series pattern vector (230) of the other item, the time series pattern vector (231) of the first other item and the time series pattern vector (232) of the second other item can be confirmed.

[0091] The hierarchical self-attention module (120) can determine the similarity between the initial time series pattern vector (201) of the target item and the initial time series pattern vector (201) of the first target item.

[0092] Each primary target stock may be one of the stocks pre-classified into the same industry as the target stock, excluding the target stock. For example, a stock called "A Heavy Industries" may be grouped in the industry category "Shipbuilding" along with stocks like "Z Shipbuilding" and "D Shipbuilding & Marine Engineering." If "A Heavy Industries" is the target stock, "Z Shipbuilding" and "D Shipbuilding & Marine Engineering" may be primary target stocks for "A Heavy Industries." In this case, "B Motors," classified in the industry category "Automobiles," may be a secondary stock for "A Heavy Industries," but may not be the primary target stock.

[0093] The hierarchical self-attention module (120) can calculate the weight of the operation target item and the weights of the first other items based on the similarity between the initial time series pattern vectors (201) for the operation target items of each first other item.

[0094] The hierarchical self-attention module (120) can extract a first time series pattern vector (211) for the target item of the operation using a second machine learning model (142) based on the weight of the target item of the operation, the initial time series pattern vector (201) of the target item of the operation, the weights of the first other items, and the initial time series pattern vector (201) of the first other items.

[0095] The hierarchical self-attention module (120) can extract final time series pattern vectors (202) for each stock using the second machine learning model (142) based on the first time series pattern vector (211) of each stock.

[0096] The hierarchical self-attention based on industry classification described above is a method that hierarchically organizes the differences in industry classification of stocks by configuring self-attention into two blocks and uses a mask matrix M to learn each block in the order of "industry -> whole", and the method described below can be a method that organizes self-attention into three blocks.

[0097] The hierarchical self-attention module (120) can extract the first time series pattern vector (211) for all items, and then determine the similarity between the first time series pattern vector (211) of the target item and the first time series pattern vector (211) of the second item.

[0098] Each secondary category may be one of several stocks pre-classified into the same industry sector as the target stock, excluding the target stock. Each industry sector may be a set of multiple industries pre-classified as being industrially related.

[0099] For example, stocks such as 'A Heavy Industry', 'B Motors', 'Z Shipbuilding', and 'D Shipbuilding & Marine Engineering' may be grouped together under the industrial sector category called 'Manufacturing'. If 'A Heavy Industry' is the target stock for calculation, 'B Motors', 'Z Shipbuilding', and 'D Shipbuilding & Marine Engineering' may be secondary stocks with respect to 'A Heavy Industry'. In this case, 'C Sugar', which is classified under the industrial sector category called 'Consumer Goods', may be a secondary stock with respect to 'A Heavy Industry', but may not be a secondary stock.

[0100] The hierarchical self-attention module (120) can calculate the weight of the operation target item and the weights of the second other items based on the similarity between the first time series pattern vectors (211) for the operation target items of each second other item.

[0101] The hierarchical self-attention module (120) can extract a second time series pattern vector (212) for the target item of the operation using a second machine learning model (142) based on the weight of the target item of the operation, the first time series pattern vector (211) of the target item of the operation, the weights of the second other items, and the first time series pattern vectors (211) of the second other items.

[0102] The hierarchical self-attention module (120) can extract final time series pattern vectors (202) for each stock using a second machine learning model (142) based on the second time series pattern vectors (212) of each stock.

[0103] The hierarchical self-attention module (120) can extract the second time series pattern vector (212) for all items, and then determine the similarity between the second time series pattern vector (212) of the target item and the second time series pattern vectors (212) of all other items.

[0104] The hierarchical self-attention module (120) can calculate the weight of the operation target item and the weights of other items based on the similarity between the second time series pattern vectors (212) for the operation target item of each other item.

[0105] The hierarchical self-attention module (120) can extract a final time series pattern vector (202) for the target item by using a second machine learning model (142) based on the weight of the target item, the second time series pattern vector (212) of the target item, the weights of other items, and the second time series pattern vectors (212) of the other items.

[0106] The hierarchical self-attention module (120) can calculate the weight of the operation target item and the weights of the first other items for the operation target item so that the sum of the weights of the operation target item and the weights of all first other items for the operation target item becomes 1 as the similarity between the initial time series pattern vectors (201) for the operation target item of each first other item increases.

[0107] The hierarchical self-attention module (120) can calculate the weight of the operation target item and the weights of the second other items for the operation target item so that the sum of the weights of the operation target item and the weights of all second other items for the operation target item becomes 1 as the similarity between the first time series pattern vectors (211) for the operation target item of each second other item increases, and the weight of each second other item for the operation target item increases.

[0108] The hierarchical self-attention module (120) can calculate the weight of the operation target item and the weights of the other items for the operation target item so that the sum of the weights of the operation target item and the weights of all other items for the operation target item becomes 1 as the similarity between the second time series pattern vectors (212) for the operation target item of each other item increases, and the weight of each other item for the operation target item increases.

[0109] At least one component may be added or deleted in response to the performance of the components described above. Furthermore, those skilled in the art will readily understand that the relative positions of the components may be altered in response to the performance or structure of the system.

[0110] Figure 5 is a flowchart of a control method for a stock price fluctuation prediction system according to one embodiment. This is merely a preferred embodiment for achieving the purpose of the present invention, and it is understood that certain components may be added or deleted as needed.

[0111] Referring to FIG. 5, a time series encoder (110) may extract initial time series pattern vectors (201) for each of a plurality of stocks using a first machine learning model (141) based on stock price data including at least one of the opening price, high price, low price, and closing price for dates of a preset period of time for a plurality of stocks (1001). The time series encoder (110) may transmit the initial time series pattern vectors (201) to a hierarchical self-attention module (120).

[0112] The hierarchical self-attention module (120) determines the similarity between the initial time series pattern vector (201) of the target item to the initial time series pattern vector (201) of the first other item, and based on the similarity between the initial time series pattern vectors (201) of each target item of the first other item, can calculate the weight of the target item and the weights of the first other items for the target item (1002).

[0113] By means of a hierarchical self-attention module (120), a first time series pattern vector (211) for the target stock can be extracted (1003) using a second machine learning model (142) based on the weight of the target stock, the initial time series pattern vector (201) of the target stock, the weights of the first other stocks, and the initial time series pattern vector (201) of the first other stocks.

[0114] The hierarchical self-attention module (120) can extract the first time series pattern vector (211) for all items, and then determine the similarity between the first time series pattern vector (211) of the target item and the first time series pattern vector (211) of the second other item. The hierarchical self-attention module (120) can calculate the weight of the target item and the weights of the second other items for the target item based on the similarity between the first time series pattern vectors (211) for the target item of each second other item (1004).

[0115] The hierarchical self-attention module (120) can extract a second time series pattern vector (212) for the target item of the operation using a second machine learning model (142) based on the weight of the target item of the operation, the first time series pattern vector (211) of the target item of the operation, the weights of the second other items, and the first time series pattern vector (211) of the second other items (1005).

[0116] The hierarchical self-attention module (120) can extract the second time series pattern vector (212) for all stocks, and then determine the similarity between the second time series pattern vector (212) of the stock to be operated and the second time series pattern vectors (212) of all other stocks. The hierarchical self-attention module (120) can calculate the weight of the stock to be operated and the weights of other stocks for the stock to be operated based on the similarity between the second time series pattern vectors (212) for each other stock to the stock to be operated (1006).

[0117] The hierarchical self-attention module (120) can extract the final time series pattern vector (202) for the target stock based on the weight of the target stock, the second time series pattern vector (212) of the target stock, the weights of other stocks, and the second time series pattern vectors (212) of the other stocks using the second machine learning model (142) (1007). The hierarchical self-attention module (120) can transmit the final time series pattern vectors (202) for all stocks to the stock price prediction module (130).

[0118] By the stock price prediction module (130), based on the final time series pattern vector (202) of each of the above stocks, the stock price fluctuation for each of the above stocks on the day following the last day of the preset period for each of the above stocks can be predicted (1008) using the third machine learning model.

[0119] An experiment was conducted to verify the performance of a stock price fluctuation prediction system (100) according to an embodiment of the present invention using ACL18 as a dataset for learning and evaluation. ACL18 consists of daily stock price data for 88 stocks with high trading volumes in the NASDAQ and NYSE stock markets. In this experiment, data for three stocks with no data within the training data period were excluded from ACL18. In addition, the industry classification data used in this study consists of information on the industry and industry sector of stocks included in ACL18 collected through Yahoo Finance. Stock price data, including daily opening and closing prices, have different ranges of values ​​for each stock. Accordingly, a closing price-based method, as shown in Table 1, was used as a data normalization method.

[0120] FIG. 6 is a graph showing the results of an experiment using a stock price fluctuation prediction system according to one embodiment, and FIG. 7 is a table showing the results of an experiment using a stock price fluctuation prediction system according to one embodiment.

[0121] Referring to Figure 6, Accuracy (ACC) and Matthews Correlation Coefficient (MCC) were used as indicators to evaluate the performance of stock price fluctuation prediction. ACC is calculated as the ratio of data where the actual and predicted values ​​match among True Positive (TP), True Negative (TN), False Positive (FP), and False Negative (FN) values, as shown in Equation 4. MCC is a performance indicator that measures more balanced performance across the four items, as shown in Equation 5.

[0122]

[0123] [Equation 4]

[0124]

[0125]

[0126] [Equation 5]

[0127]

[0128]

[0129] In order to evaluate the performance of the stock price fluctuation prediction system (100), the proposed model of the stock price fluctuation prediction system (100) was compared with the LSTM model and the Transformer model that do not consider the correlation between stock items. In addition, in order to verify the validity of the time series encoder (110) in the proposed model, the time series encoder (110) was configured with LSTM and Attentive LSTM, and in order to verify the performance of the industry-based hierarchical self-attention, the performance was compared when the industry-based hierarchical self-attention was configured with a Transformer.

[0130] Referring to Figures 6 and 7, the results of measuring the average and standard deviation of performance by performing 10 independent experiments for each model in this experiment can be confirmed. The evaluation results show that the performance of models that consider the correlation between stocks was improved overall compared to models that did not consider the correlation between stocks when predicting stock price fluctuations (LSTM, Transformer). In addition, the performance of models that applied a time series encoder (110) was higher than that of LSTM-based models, and the proposed model showed the highest performance. Therefore, it can be confirmed that the time series encoder (110) that extracts the time series pattern of stock prices of the proposed model of the stock price fluctuation prediction system (100) and the hierarchical self-attention based on industry classification that hierarchically captures the correlation between stocks according to industry classification helped improve the performance of stock price fluctuation prediction.

[0131] The time series encoder (110), the hierarchical self-attention module (120), the stock price prediction module (130), the first machine learning unit (151), and the second machine learning unit (152) may include any one of a plurality of processors included in the stock price fluctuation prediction system (100). In addition, the social network posting classification method according to the embodiments of the present invention described so far and the embodiments to be described hereinbelow may be implemented in the form of a program that can be driven by a processor.

[0132] Here, the program may include program commands, data files, and data structures, either singly or in combination. The program may be designed and produced using machine language code or high-level language code. The program may be specifically designed to implement the control method of the stock price fluctuation prediction system (100) described above, or may be implemented using various functions or definitions that are known and available to those skilled in the art of computer software. The program for implementing the control method of the stock price fluctuation prediction system (100) described above may be recorded on a recording medium readable by a processor. In this case, the recording medium may be a memory (140).

[0133] The memory (140) can store a program that performs the operations described above and the operations described below, and the memory (140) can execute the stored program. In the case where there are multiple processors and memories (140), they can be integrated into a single chip or can be provided in physically separate locations. The memory (140) can include volatile memory such as Static Random Access Memory (S-RAM) and Dynamic Random Access Memory (D-RAM) for temporarily storing data. In addition, the memory (140) can include nonvolatile memory such as Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM), and Electrically Erasable Programmable Read Only Memory (EEPROM) for long-term storage of control programs and control data.

[0134] The processor may include various logic circuits and arithmetic circuits, process data according to a program provided from memory (140), and generate control signals according to the processing results. The processor and memory (140) may be provided in a device or server equipped with a stock price fluctuation prediction system (100).

[0135] The disclosed embodiments have been described with reference to the attached drawings as described above. Those skilled in the art will understand that the present invention can be implemented in forms other than the disclosed embodiments without altering the technical spirit or essential features of the present invention. The disclosed embodiments are illustrative and should not be construed as limiting.

Claims

1. A time series encoder configured to extract initial time series pattern vectors for each of a plurality of stocks using a first machine learning model based on stock price data including at least one of information on opening price, high price, low price, and closing price for dates of a preset period of a plurality of stocks; A hierarchical self-attention module configured to extract final time series pattern vectors for each of the stocks using a second machine learning model based on the initial time series pattern vectors of each of the stocks and a preset industry classification for each of the stocks; and A stock price fluctuation prediction system including a stock price prediction module configured to predict stock price fluctuations for each of the stocks on the day following the last day of the preset period for each of the stocks using a third machine learning model based on the final time series pattern vector of each of the stocks.

2. In paragraph 1, A stock price fluctuation prediction system further comprising a first machine learning unit that sets the stock price data for learning of each stock as an input variable, sets the initial time series pattern vector for learning corresponding to the stock price fluctuation prediction data for learning of the stocks as an output variable, and learns the first machine learning model through a machine learning method based on a hierarchical transformer based on the initial time series pattern vector corresponding to the actual stock price fluctuation result data of the stocks.

3. In paragraph 1, A stock price fluctuation prediction system further comprising a second machine learning unit that sets the initial time series pattern vectors for learning of each stock extracted based on the stock price data for learning of each stock and the industry classification of each stock as input variables, sets the stock price fluctuation prediction data for learning of the stocks corresponding to the final time series pattern vectors for learning output based on the initial time series pattern vectors for learning as output variables, and learns the second machine learning model through a hierarchical transformer-based machine learning method based on the actual stock price fluctuation result data of the stocks.

4. In paragraph 1, The hierarchical self-attention module above: Determine the similarity between the initial time series pattern vector of the target stock, which is one of the above stocks, and the initial time series pattern vector of another stock; Based on the similarity between the initial time series pattern vectors for each of the above-mentioned other stocks and the target stock for the above-mentioned operation, the weight of the target stock for the above-mentioned operation and the weights of the other stocks are calculated; and It is configured to extract a final time series pattern vector for the target stock based on the weight of the target stock, the initial time series pattern vector of the target stock, the weights of the other stocks, and the initial time series pattern vectors of the other stocks. Each of the above-mentioned stocks is a stock price fluctuation prediction system that is one of the stocks that is not the subject of the above calculation.

5. In paragraph 4, The hierarchical self-attention module above: Determine the similarity between the initial time series pattern vector of the above operation target item and the initial time series pattern vector of the first other item; Based on the similarity between the initial time series pattern vectors for the operation target stock of each of the first other stocks, the weight of the operation target stock and the weights of the first other stocks are calculated for the operation target stock; Based on the weight of the target stock for the calculation, the initial time series pattern vector of the target stock for the calculation, the weights of the first other stocks, and the initial time series pattern vectors of the first other stocks, a first time series pattern vector for the target stock for the calculation is extracted using the second machine learning model; and Based on the first time series pattern vector of each of the above items, the second machine learning model is configured to extract final time series pattern vectors for each of the above items, A stock price fluctuation prediction system, wherein each of the above first stocks is one of the stocks pre-classified into the same industry as the above calculation target stock, excluding the above calculation target stock.

6. In paragraph 5, The hierarchical self-attention module above: After extracting the first time series pattern vector for all items, the similarity between the first time series pattern vector of the target item and the first time series pattern vector of the second item is determined; Based on the similarity between the first time series pattern vectors for the operation target stock of each of the second other stocks, the weight of the operation target stock and the weights of the second other stocks are calculated for the operation target stock; Based on the weight of the above-mentioned operation target stock, the first time series pattern vector of the above-mentioned operation target stock, the weights of the second other stocks, and the first time series pattern vectors of the second other stocks, a second time series pattern vector for the above-mentioned operation target stock is extracted using the second machine learning model; and Based on the second time series pattern vector of each of the above items, the second machine learning model is configured to extract final time series pattern vectors for each of the above items, Each of the above second types of stocks is one of the stocks pre-classified into the same industrial sector as the above target stock, excluding the above target stock, A stock price fluctuation prediction system in which each of the above industrial sectors is a set of multiple industries that are pre-established as being industrially related to each other.

7. In paragraph 6, The hierarchical self-attention module above: After extracting the second time series pattern vector for all items, the similarity between the second time series pattern vector of the target item and the second time series pattern vectors of all other items is determined; Based on the similarity between the second time series pattern vectors for the operation target stock of each of the above other stocks, the weight of the operation target stock and the weights of the other stocks are calculated for the operation target stock; A stock price fluctuation prediction system configured to extract a final time series pattern vector for the target stock based on the weight of the target stock, the second time series pattern vector of the target stock, the weights of the other stocks, and the second time series pattern vectors of the other stocks using the second machine learning model.

8. In paragraph 7, The hierarchical self-attention module above: The higher the similarity between the initial time series pattern vectors for the target stock of each of the first other stocks, the higher the weight of each of the first other stocks for the target stock of the operation, and the weight of the target stock of the operation and the weights of the first other stocks are calculated for the target stock of the operation so that the sum of the weights of the target stock of the operation and the weights of all the first other stocks becomes 1; The higher the similarity between the first time series pattern vectors for the operation target stock of each of the second other stocks, the higher the weight of each of the second other stocks for the operation target stock, and the weight of the operation target stock and the weights of the second other stocks are calculated for the operation target stock so that the sum of the weights of the operation target stock and the weights of all the second other stocks becomes 1; and A stock price fluctuation prediction system configured to calculate the weight of the operation target stock and the weights of other stocks for the operation target stock so that the sum of the weights of the operation target stock and the weights of all other stocks becomes 1 as the similarity between the second time series pattern vectors for each of the other stocks increases.

9. As a control method for a stock price fluctuation prediction system, A step of extracting initial time series pattern vectors for each of a plurality of stocks using a first machine learning model based on stock price data including at least one of opening price, high price, low price, and closing price for dates of a preset period of a plurality of stocks by a time series encoder; A step of extracting final time series pattern vectors for each of the stocks using a second machine learning model based on the initial time series pattern vectors of each of the stocks and the preset industry classification for each of the stocks by a hierarchical self-attention module; and A step of predicting the stock price fluctuation of each of the stocks on the day following the last day of the preset period for each of the stocks using a third machine learning model based on the final time series pattern vector of each of the stocks by the stock price prediction module, The steps for extracting the final time series pattern vectors for each of the above items are: A step of determining the similarity between the initial time series pattern vector of the operation target item, which is one of the items, and the initial time series pattern vector of the first other item by the hierarchical self-attention module; A step of calculating a weight of the operation target item and the weights of the first other items based on the similarity between the initial time series pattern vectors for the operation target item of each of the first other items by the hierarchical self-attention module; A step of extracting a first time series pattern vector for the operation target item using the second machine learning model based on the weight of the operation target item, the initial time series pattern vector of the operation target item, the weights of the first other items, and the initial time series pattern vector of the first other items by the hierarchical self-attention module; A step of extracting the first time series pattern vector for all items by the hierarchical self-attention module, and then determining the similarity between the first time series pattern vector of the target item and the first time series pattern vector of the second item; A step of calculating a weight of the operation target item and weights of the second other items based on the similarity between the first time series pattern vectors for the operation target item of each of the second other items by the hierarchical self-attention module; A step of extracting a second time series pattern vector for the operation target item using the second machine learning model based on the weight of the operation target item, the first time series pattern vector of the operation target item, the weights of the second other items, and the first time series pattern vectors of the second other items, by the hierarchical self-attention module; A step of extracting the second time series pattern vector for all items by the hierarchical self-attention module, and then determining the similarity between the second time series pattern vector of the target item and the second time series pattern vectors of all other items; A step of calculating the weight of the operation target item and the weights of other items based on the similarity between the second time series pattern vectors for the operation target item of each of the other items by the hierarchical self-attention module; and A step of extracting a final time series pattern vector for the target stock by using the second machine learning model based on the weight of the target stock, the second time series pattern vector of the target stock, the weights of the other stocks, and the second time series pattern vectors of the other stocks by the hierarchical self-attention module, Each of the above-mentioned other items is one of the items that is not the subject of the above calculation, Each of the above first types of stocks is one of the stocks pre-classified into the same industry as the above target stock, excluding the above target stock, Each of the above second types of stocks is one of the stocks pre-classified into the same industrial sector as the above target stock, excluding the above target stock, A control method for a stock price fluctuation prediction system, wherein each of the above industrial sectors is a set of multiple industries that are pre-established to be industrially related to each other.

10. A non-transitory recording medium storing a computer-readable computer program for executing the control method of the stock price fluctuation prediction system of Article 9.

Citation Information

Patent Citations

  • Frame window

    KR1020210121774A

  • Vehicle body joint structure

    KR1020220136715A

  • Electrolytic cell for water purifier

    KR1020230017612A

  • Semiconductor package and method of fabricating the same

    KR1020240108741A