{"id":19252316,"url":"https://github.com/sccn/sevensegmentica","last_synced_at":"2025-06-14T16:07:55.057Z","repository":{"id":150759850,"uuid":"327718729","full_name":"sccn/sevenSegmentica","owner":"sccn","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-15T19:41:52.000Z","size":626,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-05T06:43:10.187Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sccn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-07T20:33:00.000Z","updated_at":"2021-01-15T19:41:54.000Z","dependencies_parsed_at":"2023-05-01T22:17:59.072Z","dependency_job_id":null,"html_url":"https://github.com/sccn/sevenSegmentica","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2FsevenSegmentica","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2FsevenSegmentica/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2FsevenSegmentica/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sccn%2FsevenSegmentica/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sccn","download_url":"https://codeload.github.com/sccn/sevenSegmentica/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240347944,"owners_count":19787236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T18:26:21.309Z","updated_at":"2025-02-23T16:50:55.197Z","avatar_url":"https://github.com/sccn.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nDownload ver.0.20 (11/08/2020 updated)\n======================================\n\n[Download\nsevenSegmentica0.20](/Media:sevenSegmentica0.20.zip‎ \"wikilink\")\n\nDemo movie on Youtube (10/08/2020 added)\n========================================\n\n[Infomax ICA demo with Seven Segmentica (EEGLAB\nplugin)](https://youtu.be/CGOw04Ukqws) on Youtube.\n\nWhat is *sevenSegmentica()* for?\n================================\n\nThis is a tool to give a classical ICA demo for decomposing overlapped\nseven-segment number displays (0-9) with independent (and kurtotic) time\nseries data with some white noise. Many of EEGLAB users have been using\nICA in data preprocessing. But are you comfortable with explaining this\ndemo for detail? I hope this demo provide a good proof of concept for\nbeginners, an educational opportunity for learners, a quick validation\nof predictions for experts, and pure fun for everyone!\n\nHow does it build simulated data?\n=================================\n\n1.  A user specify ground-truth inputs. The default selections are \"2\"\n    \"4\" \"6\", so let's use this selection as an example here.\n2.  In the seven segment mapping, for example the first input \"2\" is\n    represented by channel 1, 2, 7, 5, and 4, or \\[1 1 0 1 1 0 1\\]' in\n    Matlab.\n3.  Normalized pink noise (variance = 1) with user-specified kurtosis,\n    say 8, and data length, say 10000, is generated and assigned to \"2\".\n    This defines the ground-truth data matrix G2, which is \\[1 1 0 1 1 0\n    1\\]'\\*\\[pinknoise_length10000\\] in Matlab, creating 7x10000\n    variable. Note the critical fact in the current case (\"2\"), at this\n    stage time series data for channel 1, 2, 7, 5, and 4 are perfectly\n    correlated (identical), and the rest of the channels have just\n    zeros.\n4.  The pink noise is generated independently for each ground truth in\n    the same way. Thus, G4 and G6 are generated for \"4\" and \"6\",\n    respectively.\n5.  In addition to the ground truth inputs G2, G4, G6, a white noise E\n    with user-specified variance, say 0.3, are added to create the\n    \"mixed signal\" M such that M = G2+G4+G6+E.\n\nCorrespondence to EEG recording\n===============================\n\nNote the correspondence to EEG recoreding--in this case, M corresponds\nto scalp recording (i.e., after mixing via volume conduction), and G2,\nG4, G6 correspond to latent independent 'effective sources' (i.e.,\nbefore mixing). The location of each stroke in seven segment display\ncorresponds to electrodes. But note also the critical difference--in\nstandard EEG recording, you don't know ground truth. Therefore, even if\nyou obtain ICA results, it is not immediately clear (and ultimately not\nclear either) if the decomposition is good or bad. However, in this demo\nbecause we have ground truth defined on the same seven segment number\ndisplay, we can evaluate how good the decomposition quality is\nimmediately and intuitively--if you can read the number, it means\nsuccessful!\n\nHow do we evaluate goodness of decomposition?\n=============================================\n\nResidual variance (r.v.)\n------------------------\n\nAfter ICA is performed, \"min r.v.\" at the bottom of the first GUI page\nis provided. This is calculated by sum((D1-D2).^2)/sum(D2.^2) where D1\nis 7x1 ground truth vector; for example, in the case of \"2\" it is \\[1 1\n0 1 1 0 1\\]'. D2 is also 7x1 size but this is from obtained\ndecomposition. *'Minimum* r.v.' means that because ICA does not find\ncorrespondence between input ground truth and the output, the r.v. shown\nhere is the smallest value across 10 comparisons against all the ground\ntruths. Smaller the r.v., more similar the seven-segment representations\nare.\n\nCorrelation coefficient (r)\n---------------------------\n\nThis measure is available only when you know ground truth. The\ncorrelation is calculated between the time series of the ground truth\nyou used as input and IC activations.\n\nPercent variance accounted for (PVAF)\n-------------------------------------\n\nThis is also a measure available only when you know ground truth. PVAF\nis calculated as 100\\*100-var(Y1-Y2)/var(Y2) where Y1 is time series of\nground truth and Y2 time series of IC activation. Note that this\ndefinition/calculation of PVAF is different from that is supported in\n*envtopo()*, in which PVAF = 100\\*100-mean(var(Z1-Z2))/mean(var(Z2))\nwhere Z1 (scalp back-projection of selected ICs) and Z2 (scalp\nback-projection of all ICs) are both channel x time, and variance is\ncalculated across channels, then averaged across time.\n\nWhy does ICA work?\n==================\n\nIn this demo, note how ICA maximizes non-Gaussianity in the probability\ndensity function (PDF) plots in the top row of the second-page GUI. This\nPDF is calculated after normalizing the signal to Z-score. Because of\ncentral limit theorem (CLT), PDF of each channel of M becomes\nnecessarily more Gaussian than each of 'effective sources' G.\n\n*`Central`` ``Limit`` ``Theorem`` ``(CLT)`*\n`Mixing signals   -\u003e Approaching to Gaussianity (kurtosis == 3)`\n`Unmixing signals -\u003e Departure from Gaussianity (sub/super-Gaussian)`\n\nTherefore, as long as the mixing process exists, there is always\npossibility for ICA to work in. In fact, the mixing process is\nguaranteed in scalp-recorded EEG by volume conduction, which is a\nproblem of how an electric field is formed between cortical surface and\nelectrode surface.\n\nHow do I obtain better decomposition performance?\n=================================================\n\nGenerally, ICA works better if 1) data are more non-Gaussian (bit in\nthis demo, only super-Gaussianity, which is kurtosis\\\u003e=3 is supported);\n2) data are longer; 3) there is less noise.\n\nSuggested experiments and quiz\n==============================\n\nBased on the above argument, it is clear that in order to achieve seven\nnumber decomposition, you need to set 1) very high kurtosis, 2) very\nlong data, and/or 3) very little noise. Because this is simulation, you\ncan set any arbitrary numbers here if you don't mind spending longer\ndata for ICA. However, what is the minimum condition to decompose seven\nnumbers? Consider Think about the following points.\n\n-   Try to find a set of limit parameters that barely performs\n    successful decomposition--for example, for a given number of ground\n    truth inputs, kurtosis 6 but not 5, data length 15000 but not 10000,\n    or white noise variance 0.25 but not 0.30.\n-   Press \"Mix them\" and \"Decompose the mixture\"--does it change the\n    result? How badly stochastic the results is?\n-   Change the choice of ground truth, without changing the total number\n    of them. Does it affect the results? Does the number of strokes in\n    the numbers matter? Is it easier to decompose \"1\" than \"8\"? Why?\n-   Change the number of ground truth inputs. How does it affect the\n    result? Why?\n-   Note the order of the output numbers--is it always fixed? EEGLAB's\n    runica() outputs results according to signal variance. Does it\n    explain the output order?\n-   Look at the PDF plots. Why the original channel PDF plots show their\n    peaks being non-zero, though they are Z-scored? Why are the peaks in\n    the component PDF are aligned to be zero?\n-   How do ICA evaluations in spatial domain (r.v.) and time domain (r\n    and PVAF) relate to each other? Is it possible that you get good\n    result only one of the two?\n-   Set a very easy decomposition conditions with less inputs, long\n    data, and less noise, but kurtosis == 3. What happens? If you don't\n    know the answer, go back to [this\n    section](https://sccn.ucsd.edu/wiki/SevenSegmenticaDemo#Why_does_ICA_work.3F).\n-   In EEGLAB equivalent dipole fitting using Fieldtrip, we see 'r.v.'.\n    What is the ground truth used there?\n\nScreenshots\n===========\n\n![Figure1.png](images/Figure1.png)\n\n![Figure2.png](images/Figure2.png)\n\nAuthor: Makoto Miyakoshi, SCCN, INC, UCSD.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsccn%2Fsevensegmentica","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsccn%2Fsevensegmentica","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsccn%2Fsevensegmentica/lists"}