Research Projects

Starkey Genetic Algorithm Toolbox for MATLAB

Overview

This toolbox allows Starkey's genetic algorithm (GA) to be used to find high quality solutions to multivariable listening problems. A genetic algorithm is inspired by evolutionary genetics, in which better solutions are found over time using a combination of mutation (random search) and crossover (combining properties of previous solutions). The toolbox is designed with perceptual applications in mind (i.e., where a human subject judges outputs controlled by parameters such as time constants, gains, and filter lengths for audio processing devices). A major component of the Starkey GA is that its input is a series of paired comparison preference judgments. Although The MathWorks sells the "Genetic Algorithm and Direct Search Toolbox 2.1," it is not targeted towards perceptual applications and does not include a method of using subjective judgments from a human observer as input.

The toolbox has been tested with and is designed for compatibility with MATLAB 7.0 and 7.4. It does not require any other toolboxes. Due to breaking changes in MATLAB, it is unlikely that it will work with earlier versions, and it is uncertain whether it will work with later versions without additional testing and modification.

The interface of the toolbox is modeled after existing MATLAB optimization functions, such as fminsearch. For example, the GA is executed by calling the function ga and providing it with a function to optimize and a configuration object created by gaoptimset. The toolbox includes example code, including the file simscript.m, which shows a variety of ways to invoke and configure the GA. For a quick start, try the configuration GUI, gaoptimsetDialog, which is described in detail below.

The single required item in the configuration object is Parameters, which is a cell array of numeric vectors specifying the ordered, valid values for each parameter to be optimized by the GA. There must be at least one parameter (i.e., at least one vector in the cell array), but typical experiments have between two and six parameters. Varying more than this is not recommended without giving careful consideration to the population size and number of comparisons required.

Comparison Function

The "function to optimize," which we call the "comparison function," must provide a specific interface, with the inputs being two parameter vectors to be compared, and the output being an integer between -3 and 3 representing the subject's decision. A negative value indicates preference for the first alternative, 0 indicates no preference, and a positive value indicates preference for the second alternative. The magnitude represents the strength of preference from slight (1) to strong (3). Example comparison functions and their support functions are provided that the researcher may modify:

  • example ComparisonFunction.m
    presents a console interface to the subject. Presents the stimuli once and asks for a decision until a valid one is provided. This could be modified to allow repeated stimulus presentation.
  • example ComparisonFunctionGUI.m
    presents a GUI with nine large buttons to the subject: seven for the various decisions and one to play each of the stimuli. The GUI remains visible to the subject for the entire experiment as multiple decisions are made, even though the GA is calling this function once for each decision. This function should be customized by the researcher to optionally pre-generate the stimuli (for each run or for each pair, in case they are likely to be used many times during a run, or if the subject will listen to them multiple times in a single comparison), and present the stimuli in the provided callback function.
  • exampleSubjectDialog.m
    draws the GUI and sets up the callbacks needed to support the above function. The researcher may modify this function if a different layout, different labels, or different options (e.g., 2IFC) are desired.

Configuration GUI

As an alternative to the code-based approach of creating a configuration structure with gaoptimset, a GUI that allows the researcher to access all key configuration options, including parameter arrays, is provided in gaoptimsetDialog. Additionally, this GUI allows the researcher to select the comparison function and to initiate the run. The controls include:

  1. A button to start the GA.
  2. A button that allows the comparison function's M-file to be chosen.
  3. A dropdown list allowing the number of parameters to be chosen.
  4. An area that allows the range, number of steps, and spacing type for each parameter to be chosen
  5. Dropdown lists that allow common configuration options to be edited.
  6. Dropdown lists that allow advanced options to be modified.
  7. Options that allow details of the run (a journal) to be turned off, sent to the MATLAB console ('screen'), or sent to a file named journal.log. The second option, Journal level, adds additional details (convergence measures and the preference matrix at the end of each round) to the journal output.

Summary of gaoptimset Parameters

The table below summarizes all parameters available for configuring the GA via gaoptimset. All options except the final two, which cause summary graphs to be produced, are available in the configuration GUI. Valid values are shown in brackets with default values shown in braces.

Parameter Name Description
Parameter Cell array of vectors of ordered parameter values taken by comparison function. This is the only parameter that must be specified as the default is an empty set (resulting in a single gene, the empty gene, which is insufficient for running the search algorithm).
PopSize Size of the population

[ positive integer greater than 2 {5} ]
MutateRate Strength of mutation—standard deviation of disturbance added to each parameter as a proportion of full scale

[ positive scalar {1/6} ]
HypergeoQ Hypergeometric exponent used in selection distribution. Zero (0) gives completely random (uniform) selection. Larger values increase the selection pressure, making it more likely that the preferred solutions will reproduce and the less preferred will not.

[ non-negative scalar not greater than 1 {1/2}]
Rounds Number of population updates before termination

[ positive integer {10} ]
Journal Whether and where a description of the run is output

[ {off} | screen | filename ]
JournalLevel The level of detail in the journal. Level 2 shows additional information about the progress of the run, specifically measures of convergence and the preference matrix.

[ {1} | 2 ]
PlotRanges Whether to produce a plot of the range of each parameter for each round at the end of the run.

[ {off} | on ]
PlotVariation Whether to produce a plot comparing population variation with variance for each round at the end of the run.

[ {off} | on ]

Instructions for getting the Starkey GA Toolbox

Starkey Laboratories, Inc. ("Starkey Labs") is currently providing the GA Toolbox software developed at the Starkey Hearing Research Center to institutions for academic research purposes, provided that the following conditions are met:

  • The requesting institution conducts nonprofit academic research.
  • The software provided remains at your institution, is utilized only by institution personnel involved in research or instruction, and is not published, distributed, or otherwise transferred or made available to third parties.
  • All publications of research involving or based on the software acknowledge Starkey Labs as the source of the software utilized.
  • The requesting institution provides Starkey Labs with feedback on the use of the software in its research and instruction, and grants Starkey Labs permission to use any information so provided in making modifications or updates to the software. Starkey Labs has complete discretion as to when and how new versions of the software will be made available for research and/or commercial use.
  • Any risk associated with using the software is the responsibility of the user and the requesting institution and is not the responsibility of Starkey Labs. Starkey Labs does not offer software support.

To obtain your copy of the GA Toolbox software, you may respond by e-mail to kelly_fitz@starkey.com. In your e-mail please cut and paste the following GA Toolbox License Agreement, provide the information requested at the bullet points below, and indicate your agreement to these terms:

GA Toolbox License Agreement

Starkey Laboratories, Inc. ("Starkey Labs") grants you permission for you and your institution to use the GA Toolbox software (the "software") for internal, nonprofit research purposes only. This non-exclusive license is without warranty By forwarding this to Starkey Labs I acknowledge and agree that:

  1. I will use the software only for nonprofit academic research;
  2. I will not publish, distribute, or transfer the software or make it available to other parties;
  3. I will acknowledge Starkey Labs as the source of the software in all publications of research involving or based upon the software;
  4. I will provide Starkey Labs with feedback on my use of the software in my research and instruction and grant Starkey Labs permission to use any information that I provide to make modifications or updates to the software; and
  5. I am responsible for all risks associated with my use of the software and Starkey Labs shall have no responsibility for the quality of the software or my use thereof; and the software is provided by Starkey Labs on an "AS IS" basis without warranty, express or implied.

Please include in the e-mail:

  • Your name
  • The name of your Institution and your affiliation
  • The version of Matlab that you are using.

As of now, the Toolbox is tested to work with Matlab versions of 2006a, 2006b, 2007a, and 2007b. It may work with other versions, but this needs to be tested.

References

Başkent, D. & Edwards, B. (2007) Simulating listener errors in using genetic algorithms for perceptual optimization (L), J. Acoust. Soc. Am., 121(6), EL238-EL243.

Başkent, D., Eiler, C. & Edwards, B. (2007) Using genetic algorithms with subjective input: Implications for fitting hearing aids and cochlear implants, Ear Hear, 28(3), 370-380.

Durant, E., Wakefield, G., VanTasell, D. & Rickert, M. (2004) Efficient Perceptual Tuning of Hearing Aids with Genetic Algorithms, IEEE Transactions on Speech and Audio Processing, 12(2).

Durant, E. & Wakefield, G. (2002) Efficient model fitting using a genetic algorithm: Pole-zero approximations of HRTFs, IEEE Transactions on Speech and Audio Processing, 10(1).

Durant, E. (2002) Hearing Aid Fitting with Genetic Algorithms, Ph.D. Dissertation.