Skip to content

Commit

Permalink
genetic algorithm completely rewritten
Browse files Browse the repository at this point in the history
  • Loading branch information
cdalitz committed Nov 15, 2012
1 parent de06265 commit 04c7206
Show file tree
Hide file tree
Showing 421 changed files with 48,777 additions and 22,354 deletions.
4 changes: 2 additions & 2 deletions ACKNOWLEDGEMENTS
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Tim DiLauro
Robert Ferguson
Andrew Hankinson
Thomas Karsten
J�rgen Killian
Jürgen Killian
Jonathan Koch
David Kolanus
Uma Kompella
Jean-Fran�ois Leon
Jean-François Leon
Andreas Leuschner
David Lewis
Moritz Muras
Expand Down
17 changes: 17 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
Changes made between Gamera File Releases
=========================================

Version 3.4.0, Nov 15, 2012
----------------------------

- GA optimization module rewritten from scratch
o evolutionary optimization now for selection and weighting implemented
o replacement of used library (GALib was replaced by EO)
o optimization process is now highly configurable
o fitness evaluation is now parallelizable

- knncoremodule is now splitted in header and implemenation file

- feature normalization for noninteractive classifier now works

- feature selection supported as a better alternative to feature weighting

- Point-types can be added

- new plugins brink_threshold and diagonal_projections (feature)
(thanks to Andrew Hankinson)

Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ recursive-include doc/html *.css
recursive-include gamera/pixmaps *.png *.py *.bmp
recursive-include gamera/test *.tiff
recursive-include src *.cpp *.c *.h makefile.* *.hpp *.txt ANNOUNCE CHANGES INSTALL LICENSE README TODO KNOWNBUG Y2KINFO
recursive-include src/eodev *
recursive-include examples *.py README *.tiff *.xml
recursive-include include *.hpp *.hxx *.h README
recursive-include win32 *.py
Expand Down
4 changes: 0 additions & 4 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ ToDo list for Gamera
algorithms. Maybe some parts of Leptonica could be useful?
- Add multilevel thresholding.
- Support FFT on Gamera images by wrapping FFT from VIGRA
- Feature selection via genetic algorithms (GA) as an alternative
to the currently implemented GA based feature weighting.
Investigate why the GA based feature weighting in Gamera produces
so poor results.
- A new menu function in the interactive classifier dialog for
highlighting outliers, i.e. possible manual misclassifications.
Can be based on MNN editing.
Expand Down
50 changes: 14 additions & 36 deletions doc/src/classify.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ particular classifier type. The currently implemented classifiers
are all *k* - nearest-neighbor, but we plan to add other classifiers
as needed.

- kNNInteractive_
- kNNInteractive
Interactive *k* nearest neighbor classifier.

- kNNNonInteractive_
- kNNNonInteractive
Noninteractive *k* nearest neighbor classifier. The weights of
the dimensions can be optimised using a genetic algorithm.

For a user-friendly way to perform GA optimization, consider the Biollante_
tool in the Gamera GUI.
For a user-friendly way to perform GA optimization, consider the module_
documentation.

.. _Biollante: gui.html#classifier-optimization-biollante
.. _module: ga_optimization.html

Image properties related to classification
------------------------------------------
Expand Down Expand Up @@ -339,13 +339,8 @@ classifier API. It adds some methods of its own.
``area``. This normalization may change the classifications that
the classifier makes, however.

- The weights of the features can be optimized using a genetic
algorithm. (See start_optimizing_).

For a user-friendly way to perform GA optimization, consider the Biollante_
tool in the Gamera GUI.

.. _Biollante: gui.html#classifier-optimization-biollante
- The selections and weights of the features can be optimized using a genetic
algorithm (See here_).

- The training data can be serialized to a classifier-specific binary file
format. This format saves and loads much faster than the Gamera XML
Expand All @@ -356,6 +351,8 @@ classifier API. It adds some methods of its own.
file, since it is portable across platforms and to future versions of
Gamera. The binary format is not guaranteed to be portable.

.. _here: ga_optimization.html

Feature management
''''''''''''''''''

Expand Down Expand Up @@ -401,6 +398,11 @@ the following settings are plain properties of all kNN classifier classes:

.. docstring:: gamera.knn kNNInteractive change_feature_set

.. docstring:: gamera.knn _kNNBase get_selections_by_features get_selections_by_feature
.. docstring:: gamera.knn _kNNBase get_weights_by_features get_weights_by_feature
.. docstring:: gamera.knn _kNNBase set_selections_by_features set_selections_by_feature
.. docstring:: gamera.knn _kNNBase set_weights_by_features set_weights_by_feature

.. docstring:: gamera.knn _kNNBase save_settings load_settings

Serialization
Expand All @@ -419,18 +421,6 @@ Evaluation

.. docstring:: gamera.knn kNNInteractive noninteractive_copy

``kNNNonInteractive``
'''''''''''''''''''''

Optimization
````````````

These methods pertain to optimizing the feature weights of the classifier
using a genetic algorithm (GA). For information about genetic algorithms,
see [Holland1975]_. The GA implementation in Gamera is based on [GAlib]_.

.. docstring:: gamera.knn kNNNonInteractive start_optimizing stop_optimizing add_optimization_callback remove_optimization_callback

Improving kNN Classifiers using Editing
'''''''''''''''''''''''''''''''''''''''

Expand Down Expand Up @@ -493,15 +483,3 @@ Integrating your own editing algorithm
If you have written your own editing algorithm and want to make it available in
the Classifier GUI, refer to the documentation of the class
**gamera.knn_editing.AlgoRegistry**.


References
----------

.. [Holland1975] Holland, J. H. 1975. *Adaptation in natural and
artifical systems.* University of Michigan Press, Ann Arbor.

.. [GAlib] Wall, M. 1999. `GAlib. A C++ Library of Genetic Algorithm
Components.`__

.. __: http://lancet.mit.edu/ga/
7 changes: 4 additions & 3 deletions doc/src/directory_heirarchy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ The Gamera source tree looks something like this:
| src/ | Source code (that compiles directly to object |
| | files.) |
| +---------------+------------------------------------------------+
| | ga/ | GALib_: Matthew's Genetic Algorithm Library |
| | | Used to optimize the kNN classifier. |
| | eodev/ | EOdev_: Evolving Objects (EO): an |
| | | Evolutionary Computation Framework |
| | | used to optimize the kNN classifier. |
| +---------------+------------------------------------------------+
| | graph/ | A graph library. API should be considered |
| | | unstable. |
Expand Down Expand Up @@ -86,6 +87,6 @@ The Gamera source tree looks something like this:
.. _docutils: http://docutils.sf.net/
.. _Writing Gamera Plugins: writing_plugins.html
.. _VIGRA Computer Vision Library: http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/
.. _GALib: http://lancet.mit.edu/ga/
.. _EOdev: http://eodev.sourceforge.net/
.. _libtiff: http://www.libtiff.org/
.. _script-writing documentation: script.html
Loading

0 comments on commit 04c7206

Please sign in to comment.