Answers.Body: <p>Generative networks was the first popular class of topologies that had compound feedback, corrective signaling at more than one layer.  In popular network designs such as MLPs (multilayer perceptrons), CNNs (convolutional neural networks), and LSTM (long short term memory) networks, the backpropagation is a single layer mechanism.  The mechanism distributes corrective a signal creating a closed loop that ideally converges to an optimal network behavior.</p>
  
  <p>The speed, accuracy, and reliability of convergence of networks in an AI system depend on a number of engineering choices at a lower level of design and development.</p>
  
  <ul>
  <li>Selection of algorithm variants and extensions</li>
  <li>Selection of data set</li>
  <li>Drawing of the training samples</li>
  <li>Data normalization</li>
  <li>Initialization</li>
  <li>Assignment of learning rate or learning rate policy</li>
  <li>Other hyper-parameters</li>
  </ul>
  
  <p>Generative networks are designed to achieve a higher level balance between two networks, each of which have their own backpropagation, and thus have a compound feedback topology.</p>
  
  <p>Considering the original GAN approach in the context of fraud detection, a discriminative network <span class="math-container">$D$</span>, in a way, detects fraudulence originating from the generative network <span class="math-container">$G$</span>, and, in a way, <span class="math-container">$G$</span> learns authenticity from the corrective signal provided by <span class="math-container">$D$</span>, even if the authenticity learned is superficial.  However, in the case of credit card fraud detection from a numerical set of data, the fraudulence is not internal to the system to be designed as in the case of GAN.  Without both the <span class="math-container">$G$</span> and <span class="math-container">$D$</span> networks, the design is not a generative network.</p>
  
  <p>Since the comment stated, "I have to explore GAN for this problem," the key question is this.</p>
  
  <blockquote>
    <p>If this system is to benefit from a GAN, what would the GAN generate that could contribute to the solution?</p>
  </blockquote>
  
  <p>If the answer is nothing, then a GAN is not the correct approach.  A discriminative network without a generative network is not a GAN.  If this question is from an assignment to train a network using a static and already existing data set, a MLP may suffice, depending on the expectations of the teaching staff.  If that is the case, the goal will be to analyze the data set using statistical tools to determine if it is already normalized well enough to lead to excellent convergence accuracy, speed, and reliability.  If normalization is indicated, find ways to present the data to the input layer of the MLP in such a way that each input is relevant and has a well distributed range of values across the data type.</p>
  
  <p>Ensure there is no data loss in this process, and remove redundancy where it can easily be removed.  By redundancy removal is meant, if one of the dimensions of data have only four possible values of between 10 and 1,000 bytes, encode the four possible values in two bits because to do so removes unnecessary burden from the training.</p>
  
  <p>Similarly, the output layer must be chosen to produce an encoded set of possible output values and the decoding must be written to produce usable output.  In this case, it appears that the labels are, Fraudulent and Authentic.  Which means that the last layer would be a single binary threshold cell.</p>
  
  <p>For this simple MLP approach and for many of the approaches mentioned next, there are examples available in Python, Java, C++ and other languages from which implementation can be initiated.  If the design must stand up to a more realistic fraud detection scenario, either for credit cards, junk mail, banking, log-in, or communications those experienced with fraud detection know that the above approach is entirely insufficient except as a starting point for learning.  In such a case, these considerations further complicate the design of the solution.</p>
  
  <ul>
  <li>Fraudulence and authenticity is not necessarily sufficient information for investigators.
      The likelihood of fraudulence and the reason why fraudulence is suspected is also pertinent for end users of production output,
      so that security holes can be blocked and investigation may be directed toward prosecution or some other set of remedies.</li>
  <li>Fraudulence is usually a security breach phenomena that involves continuous improvement in the attacks until the attackers
      are located and their work is interrupted by arrest.
      What initially works as fraud detection may not work a week, a day, an hour, or a minute later.</li>
  <li>Fraud detection, if it to be useful in a real financial context, must be part of a fraud prevention system,
      and training on a static data set may be meaningless in that larger usage environment.</li>
  </ul>
  
  <p>In AI systems that work in real production environments, it may be worth investigating using an LSTM network in combination with a reinforcement learner.  Such may be over a beginner's level of design and implementation experience, but using either an LSTM network or a basic Q-learning approach instead of both of them together may be a reasonable starting point for dedicated students.  If the answer to the question about what a GAN could generate that would be of use must be yes, the following ideas may be helpful.</p>
  
  <ul>
  <li>A generative network could generate transaction data with a distribution that resembles authentic transactions, and such has been successful in the past.</li>
  <li>A generative network could generate transaction data with a distribution that resembles attacks on an account by a fraudulent user. That has been done too.</li>
  <li>A generative network could theoretically generate hacker agents, although this may not have yet been done.</li>
  <li>A generative network could be used to generate patterns of authentic transactions based on some authenticity measure other than the data set mentioned, and the trained discriminative network could then be employed in some way in a fraud detection system in production, although it is unclear what advantage would be gained.</li>
  </ul>
  
  <p>The reason a GAN was suggested would need to be clarified before this answer could provide a more exact direction for AI system topology and project approach.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-26T00:06:01.413Z
Answers.LastActivityDate: 2018-12-26T00:11:03.737Z
Answers.LastEditDate: 2018-12-26T00:11:03.737Z
Answers.UserDisplayName: Douglas Daseeco
Answers.Body: <p>Yes, although the traditional technique is to use Anomaly Detection for this sort of problem. The reason for that is that the space of possible frauds is very much larger than the space of legitimate transactions and so it is difficult to model the former. The usual idea is to thoroughly explore the smaller space of legitimate transactions and flag as fraudulent anything outside of that space.
  Using the GAN method could be interesting as it might identify novel fraud techniques, and those are always useful to know. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-22T09:12:34.293Z
Answers.Text: What if I don't want to implement generator and only want to implement discriminator for the above mentioned problem in GAN as I have balanced dataset through SMOTE. Is it possible and Can it be done?
Answers.UserDisplayName: Neha soni
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-22T14:30:33.193Z
Answers.Text: Yes. The discriminator in a GAN is just a binary classifier so you can use it to check for fraud / not fraud.
Answers.UserDisplayName: DrMcCleod
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-24T05:05:37.797Z
Answers.Text: Which neural network to be used as a discriminator for best possible results?
Answers.UserDisplayName: Neha soni
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-24T09:08:58.410Z
Answers.Text: What sort of data are you working with?
Answers.UserDisplayName: DrMcCleod
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-24T18:23:22.607Z
Answers.Text: Numerical data. "Credit card Fraud detection " dataset from kaggle.
Answers.UserDisplayName: Neha soni
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-24T20:23:38.593Z
Answers.Text: @Nehasoni OK, a load of nicely normalised numerical data, I would just start with a sequential network with a single hidden layer and see how that pans out. Nothing fancy at first. You might find it useful to look through some of the other Kernels on Kaggle that others have published for that dataset. They are a great resource for improving your knowledge and skills.
Answers.UserDisplayName: DrMcCleod
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-20T21:07:17.450Z
Answers.LastActivityDate: 2018-12-24T20:19:41.980Z
Answers.LastEditDate: 2018-12-24T20:19:41.980Z
Answers.UserDisplayName: DrMcCleod
Body: <p>Problem: Fraud detection
  Task : classifying transactions as either fraud/ Non-fraud using GAN </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-24T18:26:41.287Z
Comments.Text: I am working on "Fraud detection using Deep learning". The dataset for that is "Credit card frauds" from kaggle. I have to explore GAN for this problem. But unlike the algorithm of GAN, I don't want to generate data from the generator. I don't want both generator and discriminator to play a minimax game in order to achieve their objective function. I have balanced the dataset using SMOTE. Now, what if I only implement discriminator for it? Would it be a GAN ?
Comments.UserDisplayName: Neha soni
Tags: <neural-networks><generative-adversarial-networks>
Title: Can we implement GAN (Generative adversarial neural networks) for classication problem like Fraud detecion?
UserDisplayName: Neha soni
ThreadText: # Can we implement GAN (Generative adversarial neural networks) for classication problem like Fraud detecion?
  
  (Asked by: username_0 on 2018-12-20)
  
  Problem: Fraud detection
  Task : classifying transactions as either fraud/ Non-fraud using GAN
  
  **Tags:** neural-networks, generative-adversarial-networks
  > **Comments:**
  > **username_0**: I am working on "Fraud detection using Deep learning". The dataset for that is "Credit card frauds" from kaggle. I have to explore GAN for this problem. But unlike the algorithm of GAN, I don't want to generate data from the generator. I don't want both generator and discriminator to play a minimax game in order to achieve their objective function. I have balanced the dataset using SMOTE. Now, what if I only implement discriminator for it? Would it be a GAN ?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-12-26. Score: 1 | Accepted answer
  
  Generative networks was the first popular class of topologies that had compound feedback, corrective signaling at more than one layer. In popular network designs such as MLPs (multilayer perceptrons), CNNs (convolutional neural networks), and LSTM (long short term memory) networks, the backpropagation is a single layer mechanism. The mechanism distributes corrective a signal creating a closed loop that ideally converges to an optimal network behavior.
  
  The speed, accuracy, and reliability of convergence of networks in an AI system depend on a number of engineering choices at a lower level of design and development.
  
  * Selection of algorithm variants and extensions
  * Selection of data set
  * Drawing of the training samples
  * Data normalization
  * Initialization
  * Assignment of learning rate or learning rate policy
  * Other hyper-parameters
  
  Generative networks are designed to achieve a higher level balance between two networks, each of which have their own backpropagation, and thus have a compound feedback topology.
  
  Considering the original GAN approach in the context of fraud detection, a discriminative network $D$, in a way, detects fraudulence originating from the generative network $G$, and, in a way, $G$ learns authenticity from the corrective signal provided by $D$, even if the authenticity learned is superficial. However, in the case of credit card fraud detection from a numerical set of data, the fraudulence is not internal to the system to be designed as in the case of GAN. Without both the $G$ and $D$ networks, the design is not a generative network.
  
  Since the comment stated, "I have to explore GAN for this problem," the key question is this.
  
  > If this system is to benefit from a GAN, what would the GAN generate that could contribute to the solution?
  
  If the answer is nothing, then a GAN is not the correct approach. A discriminative network without a generative network is not a GAN. If this question is from an assignment to train a network using a static and already existing data set, a MLP may suffice, depending on the expectations of the teaching staff. If that is the case, the goal will be to analyze the data set using statistical tools to determine if it is already normalized well enough to lead to excellent convergence accuracy, speed, and reliability. If normalization is indicated, find ways to present the data to the input layer of the MLP in such a way that each input is relevant and has a well distributed range of values across the data type.
  
  Ensure there is no data loss in this process, and remove redundancy where it can easily be removed. By redundancy removal is meant, if one of the dimensions of data have only four possible values of between 10 and 1,000 bytes, encode the four possible values in two bits because to do so removes unnecessary burden from the training.
  
  Similarly, the output layer must be chosen to produce an encoded set of possible output values and the decoding must be written to produce usable output. In this case, it appears that the labels are, Fraudulent and Authentic. Which means that the last layer would be a single binary threshold cell.
  
  For this simple MLP approach and for many of the approaches mentioned next, there are examples available in Python, Java, C++ and other languages from which implementation can be initiated. If the design must stand up to a more realistic fraud detection scenario, either for credit cards, junk mail, banking, log-in, or communications those experienced with fraud detection know that the above approach is entirely insufficient except as a starting point for learning. In such a case, these considerations further complicate the design of the solution.
  
  * Fraudulence and authenticity is not necessarily sufficient information for investigators.
    The likelihood of fraudulence and the reason why fraudulence is suspected is also pertinent for end users of production output,
    so that security holes can be blocked and investigation may be directed toward prosecution or some other set of remedies.
  * Fraudulence is usually a security breach phenomena that involves continuous improvement in the attacks until the attackers
    are located and their work is interrupted by arrest.
    What initially works as fraud detection may not work a week, a day, an hour, or a minute later.
  * Fraud detection, if it to be useful in a real financial context, must be part of a fraud prevention system,
    and training on a static data set may be meaningless in that larger usage environment.
  
  In AI systems that work in real production environments, it may be worth investigating using an LSTM network in combination with a reinforcement learner. Such may be over a beginner's level of design and implementation experience, but using either an LSTM network or a basic Q-learning approach instead of both of them together may be a reasonable starting point for dedicated students. If the answer to the question about what a GAN could generate that would be of use must be yes, the following ideas may be helpful.
  
  * A generative network could generate transaction data with a distribution that resembles authentic transactions, and such has been successful in the past.
  * A generative network could generate transaction data with a distribution that resembles attacks on an account by a fraudulent user. That has been done too.
  * A generative network could theoretically generate hacker agents, although this may not have yet been done.
  * A generative network could be used to generate patterns of authentic transactions based on some authenticity measure other than the data set mentioned, and the trained discriminative network could then be employed in some way in a fraud detection system in production, although it is unclear what advantage would be gained.
  
  The reason a GAN was suggested would need to be clarified before this answer could provide a more exact direction for AI system topology and project approach.
  
  
  ---
  
  ### Answer by username_2 on 2018-12-20. Score: -1
  
  Yes, although the traditional technique is to use Anomaly Detection for this sort of problem. The reason for that is that the space of possible frauds is very much larger than the space of legitimate transactions and so it is difficult to model the former. The usual idea is to thoroughly explore the smaller space of legitimate transactions and flag as fraudulent anything outside of that space.
  Using the GAN method could be interesting as it might identify novel fraud techniques, and those are always useful to know.
  
  > **Comments:**
  > **username_0**: What if I don't want to implement generator and only want to implement discriminator for the above mentioned problem in GAN as I have balanced dataset through SMOTE. Is it possible and Can it be done?  
  > **username_2**: Yes. The discriminator in a GAN is just a binary classifier so you can use it to check for fraud / not fraud.  
  > **username_0**: Which neural network to be used as a discriminator for best possible results?  
  > **username_2**: What sort of data are you working with?  
  > **username_0**: Numerical data. "Credit card Fraud detection " dataset from kaggle.  
  > **username_2**: @Nehasoni OK, a load of nicely normalised numerical data, I would just start with a sequential network with a single hidden layer and see how that pans out. Nothing fancy at first. You might find it useful to look through some of the other Kernels on Kaggle that others have published for that dataset. They are a great resource for improving your knowledge and skills.  
  
  ---
  
  